Inbound flow
1
Email reaches Cloudflare
A sender addresses a message to a mailbox on a connected domain. Cloudflare receives the message through the domain’s MX routing and Email Routing configuration.
2
Email Routing invokes the Worker
Cloudflare Email Routing delivers the message to the AgentTeam Email Worker provisioned for that domain.
3
Worker writes the archive bundle
The Worker writes the exact RFC 822 bytes as
raw.eml, then writes edge.json with envelope, integrity,
and Cloudflare edge metadata. The edge.json object is the durable inbound commit marker.4
Worker notifies the web server
After the archive commit succeeds, the Worker sends a Standard Webhooks-signed
POST /rpc/agent-mail/ingest/v1/{connectionPublicId} notification to the public web server. The notification
contains bundle metadata, not raw mail bytes.5
Mail-control queues delivery
The web server verifies the Standard Webhooks signature and passes the bundle metadata to mail-control.
Mail-control validates organization, domain, archive prefix, and Worker metadata before queueing delivery.
6
Message reaches the mailbox
Mail-control reads
raw.eml from R2, verifies integrity, replays the bytes through Haraka into WildDuck, and writes the terminal result.json archive object.Outbound flow
1
Agent submits mail
The agent submits a message through the authenticated web server. The web server verifies mailbox permission before initiating submission through WildDuck.
2
ZoneMTA queues delivery
WildDuck stores the sent copy and hands the message to ZoneMTA. ZoneMTA owns queueing, retries, and bounce
behavior.
3
Mail-control relay archives the message
ZoneMTA submits the message to the mail-control internal relay. The relay verifies the sender domain, writes
relay.eml and relay.json, and builds the provider-bound delivery payload.4
Delivery result is recorded
After the selected outbound provider accepts or rejects the message, the relay writes
result.json. Retries create additional outbound bundles linked by the ZoneMTA queue ID.