operations
Inbound Pipeline
How inbound mail is validated, parsed, sanitized, and persisted.
Processing flow
- Cloudflare Email Routing forwards inbound mail to the worker email handler.
- Address existence and sender-domain policy checks run first.
- MIME is parsed and HTML/text are sanitized.
- Metadata is persisted in D1; files are persisted in R2.
- Retrieval is guarded by organization scope.
Storage paths
Attachments are stored under:
email-attachments/<organizationId>/<addressId>/<emailId>/<attachmentId>-<filename>
