Automated mail & loop protection
How wemail flags auto-replies, bounces, mailing lists and no-reply senders in your inbound mail, and the guards that keep your replies out of mail loops.
A support desk or AI agent that answers every email it receives will sooner or later answer a robot: an out-of-office reply, a bounce, a newsletter or another auto-responder that answers back. Two automatic systems replying to each other is a mail loop — hundreds of messages in minutes, a damaged sender reputation and an annoyed recipient. wemail prevents this at both ends: every inbound message is classified when it arrives, and replies to automated mail are refused and limited per recipient.
The automated field
Every `InboundMessage` — in the list, in Get an inbound message and in the inbound.received forward POST to your endpoint — carries automated. It is null when the message looks like mail from a person (also for messages received before this classification existed), otherwise { kind, signals }:
"automated": {
"kind": "auto_reply",
"signals": ["auto_submitted:auto-replied", "subject:out_of_office"]
}automated.kind values
| Parameter | Type | Required | Description |
|---|---|---|---|
bounce | kind | Optional | A delivery-status notification: null envelope sender (mail_from:null), Content-Type: multipart/report; report-type=delivery-status (content_type:delivery_status), or a mailer-daemon / postmaster sender (from:mailer-daemon, from:postmaster). Never answered, not even with force. |
auto_reply | kind | Optional | An out-of-office or other automatic reply: Auto-Submitted other than no (auto_submitted:<value>), X-Autoreply, X-Autorespond, X-Auto-Response-Suppress, Precedence: auto_reply, a read receipt (content_type:disposition_notification), or a subject starting with Out of Office, Automatic reply, Auto:, Autoreply, Abwesenheit or Εκτός γραφείου (subject:out_of_office, subject:automatic_reply, …). |
loop_suspected | kind | Optional | The same sender sent this recipient address 20 or more messages within the hour (pair_rate), or your replies to that sender hit the reply limit within the last hour (reply_guard). |
list | kind | Optional | Mailing-list or bulk mail: a List-Id, List-Unsubscribe or List-Post header (list-id, list-unsubscribe, list-post), or Precedence: bulk, list or junk (precedence:bulk, …). |
no_reply | kind | Optional | Sent from a no-reply mailbox — a local part such as noreply, no-reply, do-not-reply or notifications on the Reply-To (reply_to:no_reply), or on the From when there is no Reply-To (from:no_reply). A no-reply From with a person’s Reply-To is not flagged: the reply goes to the Reply-To. |
When several kinds match, the strongest wins in the order bounce → auto_reply → loop_suspected → list → no_reply; signals still lists every match, so you can see why a message was classified. Signals are header names and matched values only — never an address. The classification is made once, when the message is received, and is stored with it.
Filter the inbox with automated=
`GET /v3/inbound/messages` takes an automated filter: human (only messages with automated: null), any (only automated ones), or one kind — bounce, auto_reply, loop_suspected, list, no_reply. Without it every message is listed. An agent that answers mail should poll with automated=human.
curl -G https://api.wemail.io/v3/inbound/messages \
-H "Authorization: Bearer afn_live_…" \
--data-urlencode "automated=human" \
--data-urlencode "order=desc" \
--data-urlencode "fields=summary"Reply guards
`POST /v3/inbound/messages/{id}/reply` checks, in this order:
- Automated originals. If the original has an
automated.kind, the reply is refused with409 reply_blocked_automatedanddetails: { kind, signals, forceable }.force: truesends it anyway forauto_reply,list,no_replyandloop_suspected— use it for a false positive a person has checked. A bounce is never answered (forceable: false), whatever you send. - Per-recipient limit — 5 per hour, 20 per day. At most 5 replies per hour and 20 per day go from your workspace to one recipient address (every To and Cc address counts; only accepted replies are counted). The next one answers
429 reply_loop_guardwithdetails.window(hourorday) anddetails.limit, and the conversation is markedloop_suspectedfor an hour, so new mail from that sender arrives flagged (reply_guard).forcenever lifts this limit. - Fail closed. If loop protection is briefly unavailable, automatic replies answer
503 reply_guard_unavailableuntil it is back; a reply withautomated: false— written by a person — still goes. - The normal send rules — verified sender, suppressions, quota — exactly as for any email.
Your replies are marked automatic
By default every reply sent through the API carries Auto-Submitted: auto-replied (RFC 3834). Well-behaved auto-responders on the other side — out-of-office replies, ticket systems — do not answer a message marked this way, so a loop is broken at their end too. Send automated: false when a person wrote the reply and it should be treated as ordinary mail.
AI agents and MCP
The MCP server gives agents list_inbound_messages (defaults to automated=human), get_inbound_message and reply_to_inbound_message. The MCP reply tool has no `force` option: an agent can never override the refusal of automated mail, and the per-recipient limit always applies. Email content is handed to the agent marked as untrusted data from an external sender.