← Writing

Cloudflare Email Routing can deliver into a Worker, not just forward

A route's destination can be a Worker that receives the full raw message — headers, body, attachments — which turns 'email forwarding' into 'programmable email'.

I knew Cloudflare Email Routing as free forwarding: mail to you@yourdomain.com lands in your Gmail. What I didn’t know: a route’s destination doesn’t have to be another inbox. It can be a Worker, and Cloudflare hands your code the full raw message — headers, body, attachments.

That changes the question from “which email provider?” to “what program receives my mail?” I now route every incoming email two places: into a Worker running a self-hosted email client (stored in my own account, in Durable Objects + R2) and a forwarded copy to the inbox where I already read mail.

Inbound is free at any scale I’ll reach. The catch is outbound — that’s a separate TIL.

← All writing Book a call →
Book a call → WhatsApp