4

I'm looking for a way to identify auto generated messages like Outlook's "Out of office" replies.

I stumbled upon a header called "Auto-submitted" that's supposed to do the trick, but Camel doesn't seems to provide this header in the "Message" object. Reference: http://www.iana.org/assignments/auto-submitted-keywords/auto-submitted-keywords.xml

Is it possible to know if a message is auto generated or human generated?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
refaelos
  • 7,927
  • 7
  • 36
  • 55
  • Hmm camel-mail does propagate all the MailMessage headers to the Camel Message, at least in the source code :). I wonder if you can see other kind of headers? – Claus Ibsen Jun 13 '11 at 07:28
  • I tried to look inside the headers but i can't find anything that can tell me if the message was auto generated or not. – refaelos Jun 15 '11 at 10:12
  • Check out http://stackoverflow.com/a/301958/8479 – Rory Feb 27 '16 at 00:23

1 Answers1

6

I don't know Apache Camel, but I can tell you that there is no simple and safe way to detect automated email messages in general. Headers like auto-submitted are an indicator, but unfortunately lots of automated scripts do not add them. I once had to write an out-of-office implementation that should not send ooo replies to any automated messages (mailing lists, spam, newsletters, etc.). Here is what I finally came up with, maybe this helps in your case as well:

Sender address regular expressions that indicate automated senders:

  • "^owner-"
  • "^request-"
  • "-request@"
  • "bounce.*@"
  • "-confirm@"
  • "-errors@"
  • "^no[-]?reply"
  • "^donotreply"
  • "^postmaster@"
  • "^mailer[-_]daemon@"
  • "^mailer@"
  • "^listserv@"
  • "^majordom[o]?@"
  • "^mailman@"
  • "^nobody@"
  • "^bounce"
  • "^www(-data)?@"
  • "^mdaemon@"
  • "^root@"
  • "^news(letter)?@"
  • "^webmaster@" (role address - may not be a good indicator in your case)
  • "^administrator@" (role address - may not be a good indicator in your case)
  • "^support@" (role address - may not be a good indicator in your case)

Headers that indicate automated messages if they exist:

  • list-help
  • list-unsubscribe
  • list-subscribe
  • list-owner
  • list-post
  • list-archive
  • list-id
  • mailing-List
  • x-facebook-notify
  • x-mailing-list
  • x-cron-env
  • x-autoresponse
  • x-eBay-mailtracker

Headers that indicate automated messages if they have a special value:

  • 'x-spam-flag':'yes'
  • 'x-spam-status':'yes'
  • 'X-Spam-Flag2': 'yes'
  • 'precedence':'(bulk|list|junk)'
  • 'x-precedence':'(bulk|list|junk)'
  • 'x-barracuda-spam-status':'yes'
  • 'x-dspam-result':'(spam|bl[ao]cklisted)'
  • 'X-Mailer':'^Mail$'
  • 'auto-submitted':'auto-replied'
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Gryphius
  • 75,626
  • 6
  • 48
  • 54
  • I'll check those out. Thanks a lot ! – refaelos Jun 17 '11 at 18:39
  • I just tried to look for any of those headers in an autoreply outlook generated and none of the exist ... – refaelos Jun 18 '11 at 18:52
  • 1
    yes, unfortunately, the outlook ooo assistant does not add any of those. that's why out-of-office implementations usually also have a rule to send only one reply per sender and day, to avoid flooding each other. http://stackoverflow.com/questions/1027395/detecting-outlook-autoreply-out-of-office-emails – Gryphius Jun 18 '11 at 20:07
  • I just checked a bunch of ms outlook generated replies. *some* of them have a header : X-Auto-Response-Suppress: All . – Gryphius Jun 18 '11 at 20:10
  • I didn't see that header. Thanks anyway. I suppose that the link you gave here is enough to understand that there's no solution using headers. Too bad :( – refaelos Jun 18 '11 at 21:34