Simple Inbox
Cloudflare Inbox

Email routing setup

Finish Cloudflare Email Service and catch-all routing after the Worker deploys.

Cloudflare Inbox depends on Cloudflare account and domain state that a repository template cannot fully automate.

Domain requirements

  • The domain must use Cloudflare DNS.
  • Email Service / Email Routing must be onboarded for the domain.
  • Cloudflare will add or ask you to add MX/TXT records for routing and sending.
  • New Email Service accounts may initially send only to verified recipients until account limits are raised.

Route mail to the Worker

In the Cloudflare dashboard:

  1. Open your domain.
  2. Go to Email Service / Email Routing.
  3. Create or enable a catch-all address, or create a specific custom address.
  4. Choose Send to a Worker.
  5. Select the deployed Cloudflare Inbox Worker.
  6. Save the rule and send a test email.

Optional API helper

The Cloudflare Inbox repo includes an email-routing helper script for destination and catch-all rules:

npm run cf:email-routing -- catch-all get --zone example.com
npm run cf:email-routing -- destination ensure --account-id <account-id> --email owner@example.com --create
npm run cf:email-routing -- catch-all set-worker --zone example.com --account-id <account-id> --worker cloudflare-inbox

The script needs a local Wrangler login or an API token with Email Routing permissions.

Test checklist

  • /docs loads on the deployed Worker.
  • /login can send a magic link to FORWARDING_ADDRESS.
  • inbound mail stores a message in R2.
  • the owner receives the forwarded copy.
  • /app shows the stored thread.
  • replying from /app sends through Email Service.

On this page