FIX: Specific email error for replies to digest emails (#9770)

This commit is contained in:
Mark VanLandingham
2020-05-14 09:04:58 -05:00
committed by GitHub
parent 42e5a5bb39
commit a047004c9a
4 changed files with 48 additions and 0 deletions

View File

@ -66,6 +66,7 @@ module Email
when Discourse::InvalidAccess then :email_reject_invalid_access
when Email::Receiver::OldDestinationError then :email_reject_old_destination
when Email::Receiver::ReplyNotAllowedError then :email_reject_reply_not_allowed
when Email::Receiver::ReplyToDigestError then :email_reject_reply_to_digest
else :email_reject_unrecognized_error
end

View File

@ -32,6 +32,7 @@ module Email
class UnsubscribeNotAllowed < ProcessingError; end
class EmailNotAllowed < ProcessingError; end
class OldDestinationError < ProcessingError; end
class ReplyToDigestError < ProcessingError; end
attr_reader :incoming_email
attr_reader :raw_email
@ -190,6 +191,7 @@ module Email
end
end
raise ReplyToDigestError if EmailLog.where(email_type: "digest", message_id: @mail.in_reply_to).exists?
raise BadDestinationAddress
end
end