What heuristics should be used to prevent a war with an answering machine?

I am currently expanding an email system with an answering machine feature. In the dark past, I saw some amazing mail loops, and now I'm trying to avoid what happens to me.

I looked at how other tools do this ('mailbot', 'vacation'), grepped up my own mail archive for suspicious mail headers, but I wonder if there is anything else I can add.

My process:

  • Refuse if the sender address is invalid (this should get rid of messages with the <> sender)
  • Refuse if the sender address matches one of the following: '^ root@ ', '^ hostmaster@ ', '^ postmaster@ ', '^ nobody@ ', '^ www@ ', ' -request@ '
  • Refuse if one of these headers is present (after normalizing spaces and subscripts): '^precedence: junk$', '^precedence: bulk$', '^precedence: list$', '^list-id:', '^content-type: multipart/report$', '^x-autogenerated: reply$', '^auto-submit: yes$', '^subject: auto-response$'
  • Refuse if the sender address has already been noticed by an answering machine in the recent past.
  • Refuse if the sender address is my own address :)
  • Receive and send the answering machine by adding Auto-response: to the topic, setting the Precedence: bulk and Auto-Submit: yes headers so that we hope that some remote mail program distributes the answering machine even more.

Is there anything I don't see?

+4
source share
3 answers

Update 2014-05-22

To find out if an incoming message is “out of office” or another automatic response, we use this procedure:

First find if the "In-Reply-To" header is present. If not, this is an automatic answer.

Else, check if 1 of these headers is present:

  • X-Auto-Response-Suppress (any value)
  • Priority (value contains volume or unwanted file or list)
  • X-Webmin-Autoreply (value 1)
  • X-Autogenerated (Reply value)
  • X-AutoReply (YES)
+3
source

In my research so far, I have come up with these rules.

Treat the incoming message as auto-generated, ignore it and the sender's blacklist if ...

  • Return-Path Header <> or Missing / Invalid Header
  • Auto-Submitted present with any value other than "no"
  • X-Auto-Response-Suppress Present Header
  • In-Reply-To missing
    • Note If I read RFC3834 correctly , your own programs SHOULD install this, but so far it seems like some answering machines are missing this (freshdesk.com).

When sending outgoing messages, make sure that ...

  • Set the Auto-Submitted: auto-generated header (or auto-replied as appropriate)
  • Issue the SMTP MAIL FROM: command MAIL FROM: with a null address <>
    • Please note that some delivery services, including Amazon SES, set their own value here, so this may not be possible.
  • Check the recipient for the blacklist created by the incoming party, and cancel sending to known answering machines.
  • Consider sending no more than 1 message per unit of time (24 hours long) for this recipient.

Notes for other answers and points

  • I think ignoring Precedence: list messages will lead to false positives, at least for my application configuration.
  • I believe the OP rule "auto-submit" is a typo and the official Auto-Submitted header

References


Comments are welcome and I will update this answer as this is a good question and I would like an authoritative answer to be created.

+2
source

Include a phrase like “This is an automatically generated response” in the body somewhere. If your message body is HTML (not plain text), you can use a style to make it invisible.

Check this phrase before answering. If it exists, chances are an automatic response.

+1
source

Source: https://habr.com/ru/post/1340079/


All Articles