---
title: "Send automatic replies only to mail from · Agent Wranglers"
url: https://agentwranglers.se/playbook/email/inbound-mail-and-replies/auto-reply-loops
id: EML-79
level: Recommended
applies: email
updated: 2026-10-27
build: a2a6bdfed830
tokens: 933
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Send automatic replies only to mail from people

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Inbound mail and replies](https://agentwranglers.se/playbook/email/inbound-mail-and-replies.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: EML-79
- Level: Recommended
- Chapter: [Inbound mail and replies](https://agentwranglers.se/playbook/email/inbound-mail-and-replies.md)
- Rule: 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.
- 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`.
- Applies when: The project sends email.
- How: 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](https://agentwranglers.se/playbook/email/message-basics/auto-submitted.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
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

```python
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
```

## Sources

- [RFC 3834, Recommendations for Automatic Responses to Electronic Mail](https://www.rfc-editor.org/rfc/rfc3834)

## Related rules

- EML-7 [Mark automated messages](https://agentwranglers.se/playbook/email/message-basics/auto-submitted.md) in Email

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/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.

- Previous: [Act on a reply only when its address token and authentication match](https://agentwranglers.se/playbook/email/inbound-mail-and-replies/verify-inbound-replies.md)
- [Inbound mail and replies](https://agentwranglers.se/playbook/email/inbound-mail-and-replies.md)
