-
-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
- Docker with Docker Compose
- Node.js 22 or newer
- A Cloudflare account with Email Routing, Workers, R2, Queues, and optionally Email Service
- A private SMTP server that accepts delivery from Mailbridge
- A public HTTPS hostname routed to Mailbridge port
3090
From the repository root:
npm install
npm run setupThe interactive assistant asks for the public hostname, private SMTP destination, spam mode, outbound provider, optional trusted relay, optional Cloudflare Tunnel, R2 bucket, and Queue name.
It creates:
-
.envwith mode0600 -
wrangler.tomlwith mode0600 data/queue/secrets/mailbridge-r2-private.pemsecrets/mailbridge-r2-public.pem- independently generated inbound and outbound webhook secrets
It asks before overwriting an existing .env or wrangler.toml, and it never prints generated secrets.
For SendGrid, Resend, or Mailgun, set the provider API key in .env:
RELAY_API_KEY=replace_with_provider_keyMailgun also requires MAILGUN_DOMAIN. Cloudflare Email Service requires CLOUDFLARE_SEND_WORKER_URL.
Use the commands printed by the setup assistant:
npx wrangler r2 bucket create mailbridge-inbound
npx wrangler queues create mailbridge-inbound
npx wrangler secret put WEBHOOK_SECRET
npx wrangler secret put CLOUDFLARE_SEND_WEBHOOK_SECRET
npx wrangler secret put MAILBRIDGE_PUBLIC_KEY_PEM < secrets/mailbridge-r2-public.pem
npx wrangler deployEnter the corresponding values from .env when Wrangler prompts for the webhook secrets. The public key is piped directly from disk.
docker compose up -d --build
docker compose ps
docker logs -f mail-bridgeCheck the health endpoint:
curl http://127.0.0.1:3090/healthExpected response: OK.
Follow Testing and Operations. Keep the SMTP relay disabled until its CIDR allowlist and TLS behavior have been verified.
Copyright (c) 2026 Voxvey Research LLC, a Helio company.