EML-79Recommended
Send automatic replies only to mail from people
Send no automatic reply to a message that carries Auto-Submitted other than no, a List-Id or a Precedence of bulk, list or junk. Mark every automatic reply Auto-Submitted: auto-replied, and send at most one to a sender in 7 days.
How to do it
Two systems that answer each other's automatic mail loop until a quota runs out. Out-of-office replies, ticket acknowledgements and bounce notices are the usual pair. RFC 3834 sets the rules. Skip mail marked as automatic, skip mailing lists, and send the reply to the Return-Path address, never to From or Reply-To. Keep a record of who got an automatic reply and when, and suppress repeats for 7 days, the period RFC 3834 suggests. Mark the messages you send on your own as Mark automated messages says.
Examples
JavaScript example
const REPLY_GAP_MS = 7 * 24 * 60 * 60 * 1000;
export function mayAutoReply(headers, lastRepliedAt, now = Date.now()) {
const auto = (headers['auto-submitted'] ?? 'no').toLowerCase();
const precedence = (headers.precedence ?? '').toLowerCase();
if (auto !== 'no' || headers['list-id'] || ['bulk', 'list', 'junk'].includes(precedence)) return false;
return !lastRepliedAt || now - lastRepliedAt > REPLY_GAP_MS;
}
Python example
from datetime import datetime, timedelta, UTC
REPLY_GAP = timedelta(days=7)
def may_auto_reply(headers: dict, last_replied_at: datetime | None) -> bool:
auto = headers.get("auto-submitted", "no").lower()
precedence = headers.get("precedence", "").lower()
if auto != "no" or "list-id" in headers or precedence in {"bulk", "list", "junk"}:
return False
return last_replied_at is None or datetime.now(UTC) - last_replied_at > REPLY_GAP
How to check
Feed the inbound handler a message with Auto-Submitted: auto-replied, one with a List-Id, and two normal messages from one sender within a day. Only the first normal message gets a reply, and that reply carries Auto-Submitted: auto-replied.
Sources
Related rules
- EML-7 Mark automated messages in Email
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/email/inbound-mail-and-replies/auto-reply-loops">Agent Wranglers email playbook</a>. In code you write, add a comment next to it with the same link.