Defect #19558

Mail handler should not ignore emails with x-auto-response-suppress header

Added by Moritz Schepp about 3 years ago. Updated almost 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Email receiving
Target version:3.0.2
Resolution:Fixed Affected version:3.0.1

Description

I can see from the code that certain values within x-auto-response-suppress headers in received mail make redmine ignore the mail. It seems to me that this is not correct since the header is about suppressing (subsequent) auto responses, not about flagging the current mail as auto response. See https://msdn.microsoft.com/en-us/library/ee219609%28v=exchg.80%29.aspx

For example, when adding redmine to an Exchange 2010 distribution list, it will always receive the header for mail sent via that list.

mailer.patch Magnifier - trunk @14155 (1.18 KB) Sebastian Paluch, 2015-04-06 20:07

mailer.patch Magnifier - trunk @14155 (2.09 KB) Sebastian Paluch, 2015-04-06 20:17


Related issues

Related to Redmine - Patch #19322: Allow to ignore auto reply messages from Exchange server Closed

Associated revisions

Revision 14159
Added by Jean-Philippe Lang about 3 years ago

Mail handler should not ignore emails with x-auto-response-suppress header (#19558).

Patch by Sebastian Paluch.

History

#1 Updated by Toshi MARUYAMA about 3 years ago

  • Related to Patch #19322: Allow to ignore auto reply messages from Exchange server added

#2 Updated by Toshi MARUYAMA about 3 years ago

  • Target version set to 3.0.2

#3 Updated by Toshi MARUYAMA about 3 years ago

I don't know about Exchange, should #19322 be reverted?

#4 Updated by Moritz Schepp about 3 years ago

... well the header x-auto-response-suppress is only used by exchange. As far as I understand the docs, the header doesn't identify auto-reponses. It has been added as an exclusion pattern to the mail_handler for #10607. Afaik, it should'nt have been.

#5 Updated by Toshi MARUYAMA about 3 years ago

  • Status changed from New to Needs feedback
  • Target version deleted (3.0.2)

I think #19322 is correct because Redmine 3.0.1 ignores only "oof" and "all".
source:tags/3.0.1/app/models/mail_handler.rb#L76

  @@ignored_emails_headers = {
    'X-Auto-Response-Suppress' => /(oof|all)/,
    'Auto-Submitted' => /\Aauto-(replied|generated)/,
    'X-Autoreply' => 'yes'
  }

http://serverfault.com/questions/277515/how-does-exchange-2010-prevent-auto-reply-loop

#6 Updated by Moritz Schepp about 3 years ago

... so the header sais: "do not send auto replies to this email", it doesn't say "this email is an auto reply". Exchange seems to add the header to auto replies (that's what the second answer on serverfault sais and it makes sense to prevent loops). That doesn't mean that the header's presence is an indication for an auto reply. For example, Exchange adds the header to all mails sent to distribution list members (makes sense because some recipient might always be on holiday and the sender usually doesn't care). Those would then be filtered by redmine.

#7 Updated by Toshi MARUYAMA about 3 years ago

  • Status changed from Needs feedback to New
  • Target version set to 3.0.2

#8 Updated by Sebastian Paluch about 3 years ago

well.. I dig a bit more on this and it seems that Moritz is right, not only the patch #19322 is wrong but the X-Auto-Response-Suppress header should not be there in first place.

Detecting Outlook autoreply/out-of-office emails and X-Auto-Response-Suppress header
Detecting Outlook autoreply/out-of-office emails

Instead the outgoing emails, send by Redmine, should have the header set correctly.

Currently, the only related headers in outgoing emails that are set are (per Redmine 3.0.0):

X-Auto-Response-Suppress: OOF
Auto-Submitted: auto-generated

This results in suppressing only out-of-office responses but all the rest (e.g. delivery reports) are coming in.
It should be:
X-Auto-Response-Suppress: All
Auto-Submitted: auto-generated

I my case the Redmine's mail box was full of undelivered reports (thousands of emails) that mail_handler was not handling correctly. Reverting #19322 and applying attached mailer.patch should do the work.

#9 Updated by Sebastian Paluch about 3 years ago

New patch doing both, removing the header from mail_handler and changing it in mailer.

#10 Updated by Moritz Schepp about 3 years ago

Guys, thanks for looking into this!

#11 Updated by Jean-Philippe Lang about 3 years ago

  • Subject changed from Mail handler and x-auto-response-suppress to Mail handler should not ignore emails with x-auto-response-suppress header
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Patch committed in r14159, thanks for digging into this.

#12 Updated by Jean-Philippe Lang almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF