Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Detecting autoresponders

Interduo edited this page Jul 11, 2022 · 20 revisions

Detecting autoresponders – also known as "automatic vacation responders" or "out of office auto-replies" – is tricky. RFC 3834 defines the Auto-Submitted header field, which indicates that a message is an automatic response unless it is absent or its value is no. IANA maintains a list of possible values for Auto-Submitted. However, not all MTAs set Auto-Submitted on autoresponses.

  • Many MTAs set Return-Path: <> or Return-Path: <MAILER-DAEMON>, including Microsoft IIS' SMTP service (in most cases, this would signify a bounce)
  • BoxTrapper and CPanel set Preference: auto_reply, X-Precedence: auto_reply, and X-Autorespond
  • Communicate Pro sets X-Autogenerated to one of Forward, Group, Letter, Mirror, Redirect or Reply
  • Domain Technologie Control sets X-AutoReply-From and X-Mail-Autoreply
  • FirstClass sets X-FC-MachineGenerated: true
  • GMail sets Auto-Submitted: auto-replied, Precedence: bulk and X-Autoreply: yes
  • Mailtraq sets X-POST-MessageClass: 9; Autoresponder
  • qmail sets Delivered-To: Autoresponder

Some MTAs do not set any relevant headers, for example, some configurations of Microsoft Exchange Server. In such cases, it is necessary to inspect the subject line; for example, it is common for an autoresponse to begin with Out of Office AutoReply:. It is unwise to attempt to detect autoresponses using regular expressions against the message body.

The example vacation program in RFC 3834 and this Exim wiki page provide sample scripts for detecting autoresponders. mySociety's alaveteli and commonlib projects have code for detecting autoresponses.

A fairly good regular expression to detect autoresponders by inspecting the subject line is:

/\AAuto Response\z|\AOut of Office(?:\z| Alert\z| AutoReply:| Reply\z)|\bis out of the office\.?\z/i

In some cases, the subject line tests used by Alaveteli and Exim are unnecessary, as the header rules described above are sufficient.

Clone this wiki locally