Patch #33440
openEmails not being processed because of
0%
Description
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: <redmine.issue-12345.20200428144405.5@omitting.com>,<redmine.journal-67890.20200512212705.5@omitting.com>
In-Reply-To: <redmine.journal-67890.20200512212705.5@omitting.com>
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
to:
headers = [email.references, email.in_reply_to].flatten.compact
OR
The regex for MESSAGE_ID_RE needs to point to include issue
OR
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.