Skip to main content
AgentTeam Email writes every inbound and outbound message to Cloudflare R2 as a bundle of immutable artifacts in the supported self-hosted inbound path. R2 is the durable archive and completion marker store — it is not the live delivery queue, retry store, or operational database. Every object identity is a UUIDv7 in canonical lowercase form, and all date path segments are UTC.

Inbound bundle

Every message received by the Cloudflare Email Worker produces an inbound bundle at the following path:
ingest_id is a UUIDv7 generated by the Cloudflare Worker at receive time. It is not derived from the message hash, mailbox, Message-ID header, or any Cloudflare routing data. Inbound group forwarding fanout may also create target-side inbound local-route bundles for Agent Mail mailboxes. Those bundles use schema: "agent-mail.inbound.local-route.edge.v1" and link back to the source inbound bundle. They are receive-side routing records, not Cloudflare Worker commit markers and not new authored outbound sends.

Inbound files

Inbound status values

result.json carries one of three terminal statuses:
If a processing attempt fails transiently, result.json is not written and the bundle remains incomplete. The reconciler retries incomplete bundles up to three attempts before marking the Mongo queue item as blocked for operator review. Blocked items are not terminal archive state.

Outbound bundle

Every message relayed for outbound delivery produces a bundle at the following path:
send_id is a UUIDv7 generated by the internal SMTP relay at relay time. It is not the ZoneMTA queue ID.

Outbound files

Inbound group forwarding fanout may create source-side local-route relay boundary bundles. Those bundles do not include provider.eml or provider.json; they are fanout routing records, not authored outbound sends.

Outbound status values

Ordinary authored sends are provider-bound even when every recipient is on an AgentTeam Email domain. Provider-bound result.json carries one of three terminal statuses: Inbound group forwarding fanout local-route bundles carry one of two terminal statuses:
ZoneMTA owns outbound retry and bounce behavior. When ZoneMTA retries by resubmitting to the internal SMTP relay, the relay generates a new send_id and a new outbound bundle. The shared zonemta_queue_id field in relay.json links those bundles to the same ZoneMTA queue entry.

Hosted deployments

In AgentTeam Email hosted deployments, all archive objects are scoped per organization:
  • Every object is prefixed with orgs/<org_public_id>/ so bundles from different organizations never share a path namespace.
  • Archive objects are not publicly served.
  • Customer Workers receive short-lived R2 temporary credentials scoped to their organization prefix for archive writes. Parent R2 credentials remain backend-owned and are not exposed to customer Workers, browsers, public APIs, or user-facing diagnostics.