Skip to content
Ra's al Ghul edited this page Aug 9, 2026 · 2 revisions

Mailbridge

Mailbridge is a security-focused Node.js mail gateway connecting Cloudflare Email Routing to a private SMTP server. It also provides an optional CIDR-restricted SMTP relay for trusted outbound mail.

What it does

  • Encrypts inbound messages in the Cloudflare Worker before storing them in R2.
  • Sends only encrypted object references through Cloudflare Queues.
  • Decrypts messages locally, then applies SpamAssassin, optional Spamhaus, and optional AI screening.
  • Delivers accepted inbound mail to a private SMTP server.
  • Queues temporary failures in an encrypted local retry store.
  • Relays trusted outbound SMTP through SendGrid, Resend, Mailgun, or Cloudflare Email Service.

Start here

  1. Follow the Quick Start for the interactive setup.
  2. Review the Architecture and Security Model.
  3. Use the Configuration Reference for environment variables.
  4. Follow Cloudflare Setup and Deployment.
  5. Consult Testing and Operations and Troubleshooting.

The repository README remains the complete, version-controlled reference.

Clone this wiki locally