Emails not being processed because of
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:
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 about 1 month 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.