FIX: show rejected emails with unrecognized errors (#5026)

Although 407a23663df6c8e66c5c3b8e5cbf21a609de4109 will send rejection
messages for unrecognized errors, sometimes processing the email will
raise an error which has a blank message.

This commit:

1. Shows rejected emails which have already been processed and contain
   a blank error in /admin/email/rejected

2. Replaces new blank error messages with the error type
This commit is contained in:
Leo McArdle
2017-08-04 15:20:44 +01:00
committed by Régis Hanol
parent c0a2d9e671
commit 99527af38a
3 changed files with 10 additions and 2 deletions

View File

@ -69,6 +69,12 @@ describe Email::Receiver do
expect(IncomingEmail.last.is_bounce).to eq(true)
end
it "logs a blank error" do
Email::Receiver.any_instance.stubs(:process_internal).raises(RuntimeError, "")
process(:existing_user) rescue RuntimeError
expect(IncomingEmail.last.error).to eq("RuntimeError")
end
context "bounces to VERP" do
let(:bounce_key) { "14b08c855160d67f2e0c2f8ef36e251e" }