Patch #33440

Emails not being processed because of

Added by Simon Song over 2 years ago. Updated over 1 year ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:


Category:Email receiving
Target version:-


I have Redmine receive email via SMTP. I noticed about 90% of them go through just fine, that 90% of emails would update their associated tickets no problem.

However, the other 10% would not work. It would be stuck in limbo (in the inbox). I was able to track it down from the

mail_handler.rb > dispatch

The email's header for in_reply_to did not have the correct value to extract the proper object_id.

Here is an example:

References: <>,<>
In-Reply-To: <>

In this example, the 12345 was the correct ticket number, while 67890 does not exist in our Redmine.

I think the header array needs to switch from:

headers = [email.in_reply_to, email.references].flatten.compact


headers = [email.references, email.in_reply_to].flatten.compact


The regex for MESSAGE_ID_RE needs to point to include issue


dispatch has a validation to check if the object_id exists or not. If it does not, it moves on to the next array key.


#1 Updated by Maximilian Eschenbacher over 1 year ago

We are experiencing a similar issue with mail reception in case of multiple redmine instances and agents answering to one instance into another instance.

However for our case, switching the header priority is not enough as we would need to distinguish between several redmine instances.

Also available in: Atom PDF