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?
source share