Private message storage
Raw MIME, complete bodies, and attachments stay in your private R2 bucket. Downloads force attachment handling, no-store caching, and content sniffing protection.
Free and open source · Bring your own Cloudflare
Create one address or many agent mailboxes for support, research, and operations agents. Agents receive, poll, send, and reply through the API or MCP server, while the mail service and message data run in your Cloudflare account.
The software is free. Built only for Cloudflare. No hosted control plane.
Agent-assisted setup
Sign in to Cloudflare locally, give your agent the prompt, and approve every live infrastructure or DNS change.
npx wrangler loginInstall Agent Post Office from https://github.com/Agent-Post-Office/agentpostoffice-cloudflare for <your-domain>. Create mailboxes <your-mailboxes>. Follow the repository's agentpostoffice-setup skill, use my existing Wrangler login, show me proposed changes, and ask before deployment, DNS/MX changes, Email Routing activation, Email Sending onboarding, or sending real mail. Do not ask me to paste API tokens into chat.
A post office, not an inbox
Active mailboxes receive mail; disabled and unknown addresses do not. Messages stay unprocessed until an agent acknowledges them, while scoped tokens and idempotency keys keep automation boundaries explicit.
Google Workspace + Agent Post Office
Keep your human inbox in Google Workspace while Agent Post Office manages every other address on the domain. Cloudflare Email Routing connects the two.
Configure hybrid routingexample.com routing table
Mailbox automation
Activate one bounded Sieve script on a mailbox. The Worker evaluates it only for new inbound messages, then sends a static plain-text reply through a separate Automation Queue.
require ["envelope", "vacation"];
if envelope :is "to"
"support@example.com"
{
vacation :days 7
:subject "Message received"
"Thanks. An agent will review it.";
stop;
}
Stored as an inactive revision first. It runs only after explicit activation.
No inbound webhook is required. Agents initiate every API connection.
Cloudflare Email Routing invokes the Worker for the exact envelope recipient.
Raw MIME goes to private R2 before an ID-only task enters Queues.
Agents read a unified feed and explicitly mark completed messages processed.
Cloudflare Email Sending handles transactional mail with scoped authorization.
How it’s built
Six Cloudflare services run inside your account. There is no Agent Post Office account, hosted database, or message relay outside your deployment.
Cloudflare does not sponsor or endorse Agent Post Office.
Bring your own Cloudflare account
Agent Post Office does not run a hosted control plane, database, or message relay. Your deployment receives mail directly into the Cloudflare resources you provision, so there is no second Agent Post Office service holding another copy.
Raw MIME, complete bodies, and attachments stay in your private R2 bucket. Downloads force attachment handling, no-store caching, and content sniffing protection.
Only token hashes enter D1. Raw bearer tokens remain in the operating-system credential store or a protected process environment, never in URLs.
HTML is not rendered and attachments are not opened automatically. MCP output labels message content as untrusted and exposes attachment metadata before bytes.
Message content is not logged by default. Subjects, attachments, tokens, and raw addresses are also excluded from default application logs.
Open source, in public
Agent Post Office is Apache 2.0 licensed. Read the implementation, propose changes, and follow the same plan the maintainers use.
Cloudflare requirements
Workers Paid account ($5/month) A Workers Paid account is required for sending email to arbitrary recipients through Cloudflare Email Sending.
A domain on Cloudflare DNS Required for Email Routing, mail authentication records, and your agent addresses.
Your own deployment Agent Post Office is free and open source. You install and operate the Worker, D1, R2, and Queues resources.
Developer preview. Live receive, send, reply, authentication, and safe-download paths have been exercised, but do not use Agent Post Office as the only copy of business-critical mail yet.
Start with the architecture, inspect the security boundaries, then deploy deliberately.