Email Sending (outgoing)
Lumen sends mail via the Cloudflare Email Sending binding (send_email). The binding is declared in wrangler.jsonc:
"send_email": [
{ "name": "EMAIL" }
]worker/routes/send.ts builds an RFC 822 message (multipart/alternative for text + HTML, multipart/mixed when attachments are present) and submits it to the binding once per recipient.
Verified destination
Cloudflare requires the destination address of every outgoing message to be a verified address belonging to the same Cloudflare account. Set verified destinations in Email → Email Routing → Destination addresses.
For a fully open mailbox you can verify the addresses you actually need to contact, or pair Lumen with another transactional ESP. See Cloudflare's docs for the current rules.
Sender identity
A user can only send from an address that is registered in Settings → Addresses. The Worker rejects mismatched From addresses with 403.
The Message-ID header is generated as <random@<from-domain>>. Replies preserve In-Reply-To and References, so threads stay intact in receivers' clients.
Attachments
The composer base64-encodes each attachment and posts it to /api/send. The Worker decodes, builds the multipart body, and stores a copy under R2 key att/<userId>/<messageId>/<attachmentId>. The total size cap (browser side) is 20 MB; Cloudflare imposes its own per-message size cap.
Drafts
Composer state is autosaved to /api/drafts every 1.5 seconds. Drafts live in the drafts system folder; they are persisted as ordinary messages rows with folder = 'drafts' and is_read = 1. Sending consumes the draft (the Worker deletes it).