FIX: save email rejection error class names for incoming email logs (#16095)

This commit is contained in:
Arpit Jalan 2022-03-03 18:58:13 +05:30 committed by GitHub
parent a558c5bd30
commit 567be512c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -83,9 +83,7 @@ module Email
post
rescue Exception => e
error = e.to_s
error = e.class.name if error.blank?
@incoming_email.update_columns(error: error) if @incoming_email
@incoming_email.update_columns(error: e.class.name) if @incoming_email
delete_staged_users
raise
end

View File

@ -120,7 +120,7 @@ describe Email::Processor do
expect(errors.first).to include("boom")
incoming_email = IncomingEmail.last
expect(incoming_email.error).to eq("boom")
expect(incoming_email.error).to eq("RuntimeError")
expect(incoming_email.rejection_message).to be_present
expect(EmailLog.last.email_type).to eq("email_reject_unrecognized_error")

View File

@ -98,6 +98,7 @@ describe Email::Receiver do
expect { process(:old_destination) }.to raise_error(
Email::Receiver::OldDestinationError
)
expect(IncomingEmail.last.error).to eq("Email::Receiver::OldDestinationError")
SiteSetting.disallow_reply_by_email_after_days = 0
IncomingEmail.destroy_all