Inbound and threads
Receiving mail, MIME parsing, threading, and Reply-To tokens.
Early access
Inbound is metered separately from sends and is intended to be cheaper per unit. Unknown addresses are discarded and not billed. Mail that fails SPF/DKIM/DMARC or SES spam/virus verdicts is dropped or quarantined per org setting.
Path
MX → receipt rules → encrypted object storage of raw MIME → worker parses (mailparser) → route by recipient → thread → inbound.received.
Threading
- Match
In-Reply-To/Referencesto ourmessages.message_id_header - Else a VERP-style reply token in the Reply-To local part (
agent+t_<token>@…) - Else normalized subject + participants within 14 days
We store the full body and a text_reply_only field with quoted replies stripped.
Loop protection
Auto-replies (Auto-Submitted, X-Autoreply, Precedence: bulk/auto_reply) are marked. The default policy denies agent auto-responses to auto-replies and caps replies per thread per hour.
Treat inbound as untrusted
Message bodies can contain prompt-injection. MCP tools wrap bodies in a delimited field and set content_is_untrusted: true. Do not concatenate inbound text into a system prompt without isolation.
const threads = await mailroom.inboxes.listThreads(inboxId, { q: 'refund' });
const thread = await mailroom.threads.get(threads.data[0].id);
await mailroom.threads.reply(thread.data.id, { text: 'Refund issued.' });Replies go through the same policy engine as POST /emails.