Project

General

Profile

Actions

Feature #32519

open

Report more precise error in failed requests (bounced emails) from incoming emails

Added by Anthony Mallet about 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

When a user sends an invalid e-mail to rdm-mailhandler.rb, for instance with invalid project
id or missing mandatory fields, the bounced e-mail is not helpful, as it just says:

"Request was denied by your Redmine server. "
"Possible reasons: email is sent from an invalid email address or is missing some information."

And, from experience, users have hard times understanding what they got wrong.
I propose to report the actual error message so that it appears in the bounce e-mail.

Here is a quick patch that tries to avoid breaking the API of existing methods. It passes an
optional array to MailHandler.receive(), that is filled with error messages, so that
MailHandler.receive() can continue to return a boolean. Then it renders the message in the
body response of the 'unprocessable_entity' error if there is an error. rdm-mailhandler.rb
is also patched to get the response body and send it to stderr so that the MTA gets it.

There might be a cleaner way to implement this, but I tried to make it simple for now :)


Files

mail-err.patch (5.41 KB) mail-err.patch Report error message in rdm-mailhandler.rb Anthony Mallet, 2019-11-26 17:36

No data to display

Actions

Also available in: Atom PDF