The blog
Engineering notes on owning your email stack
Deep dives, honest comparisons, and field notes on running your own inbox, sender, and newsletter on Cloudflare. 131 articles

Idempotent email sending so users never get duplicate receipts
Duplicate transactional email is one of those bugs that never shows up in dev and always shows up the week you get traffic. It is rarely a bug in the email code. It is a bug in the assumption that the thing which triggers the email happens exactly once. It does not. Buttons get double-clicked, requests get retried, queues redeliver, and operators replay. Every one of those paths can fire your send a second time.
Latest
Summarize long email threads with an AI sub-call
To summarize a long email thread with AI, fetch the thread's messages in chronological order, render them into a single bounded prompt (sender plus body per message, truncated), and make one LLM sub-call with a system prompt that asks for the participants, the ask, the current state, and what needs a response. A 40-message thread becomes one model call. The interesting engineering is not the call itself, it is bounding the input so you never overrun the context window and never accidentally feed the whole inbox into the prompt.
Full-text email search with SQLite FTS5
If you are storing email in SQLite or Cloudflare D1, you eventually need search, and the instinct is to reach for WHERE body LIKE '%invoice%' . That works on a hundred rows and falls over on a hundred thousand: it scans every row, it cannot rank, it has no concept of word stems, and it lights your database CPU on fire. The correct tool has been sitting inside SQLite the whole time. It is FTS5, the full-text search extension, and email is close to its ideal workload: lots of text, read-heavy, and you want relevance plus snippets, not just a boolean hit.
SMTP relay from Cloudflare Workers: the 2026 capability boundary
SMTP is the oldest reliable thing in the email stack. You have a relay host, a port, a username and password, and a library that speaks the protocol. It has worked on every server you have ever run. Then you move the same code onto a Cloudflare Worker and it stops cold, with errors that look like networking flakiness but never resolve on retry.
One Zod tool manifest for MCP, chat, and CLI
If you expose the same capabilities to an in-app AI chat, to an external MCP client like Claude, and to a CLI, the naive path defines each tool three times. That triplication is where drift lives: a parameter gets renamed in the chat tool but not the MCP one, the CLI validates differently from the agent, and the descriptions slowly diverge until the model and the human are working from different mental models of the same action.
Set up MX records to receive mail on your own Cloudflare inbox
Receiving email is a DNS problem before it is a code problem. A sending server has no idea your inbox lives on Cloudflare. It asks DNS one question: "what is the MX record for this domain?" and delivers to whatever that record names. If the answer is missing, points at a dead host, or still names a Google Workspace you cancelled, your mail never reaches your Worker no matter how perfect the handler is. This guide walks every record from first principles, shows the failures you will actually hit, then notes how npx tinbox init publishes the same set for you. For the higher-level sequence this fits into, the steps to receive inbound email on your own Cloudflare account is the map, and the DNS records every sending domain needs covers the outbound half you will add once you also send.
How to send email from a Next.js app on Cloudflare
To send transactional email from a Next.js app deployed on Cloudflare, the most portable path is a Worker-native binding or HTTPS API from a route handler or Server Action. Workerd exposes outbound TCP, but not Node's full socket runtime; Node-oriented SMTP packages such as Nodemailer are therefore not automatically compatible, outbound port 25 is blocked, and Cloudflare-owned SMTP endpoints are unreachable over Worker TCP. Use a Worker-native helper or fetch() unless you have deliberately chosen and tested a runtime-compatible third-party submission client.
How to send bulk email in batches from a Cloudflare Worker
Sending one transactional email from a Worker is easy. Sending fifty thousand is a different problem, and the difference is not the email, it is the loop. The instant you await a send inside a single request handler, you have tied a long, failure-prone job to one invocation that Cloudflare will not keep alive long enough to finish.
Self-hosted webmail: a Gmail-style inbox you host on your own domain
When developers say "self-hosted email," they usually mean the plumbing: MX records, a mail server, maybe an API to send. The part that gets quietly dropped is the inbox itself, the human-facing UI where someone actually reads a support thread, searches for last month's receipt, and hits reply. That UI is the hard, unglamorous part, so most self-hosted email projects ship an API and tell you to bring your own client (Thunderbird, Apple Mail, a webmail package you bolt on separately).
A self-hosted newsletter tool with no per-contact tax
This is a walkthrough of running a real newsletter on infrastructure you control: sending broadcasts, segmenting your audience, tracking opens and clicks, and honoring unsubscribes, all on the same contact list as your transactional mail. It assumes your list is already in your own database. If you are still on Mailchimp and need to get your subscribers out with tags and status intact first, start with migrate your existing list in first, then come back here to operate it day to day.