-
-
Notifications
You must be signed in to change notification settings - Fork 0
Cloudflare Setup
Ra's al Ghul edited this page Aug 9, 2026
·
1 revision
The interactive setup generates wrangler.toml with:
- the
worker.jsentrypoint -
NODE_APP_URLpointing to/api/webhook/email - the
MAIL_STORER2 binding - the
MAIL_QUEUEproducer and consumer bindings - the top-level
EMAILEmail Service binding
The Email Service binding must use top-level Wrangler syntax:
[[send_email]]
name = "EMAIL"Do not place send_email inside a queue consumer block.
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-
WEBHOOK_SECRETauthenticates inbound Worker calls to Mailbridge. -
CLOUDFLARE_SEND_WEBHOOK_SECRETauthenticates outbound Mailbridge calls to the Worker. -
MAILBRIDGE_PUBLIC_KEY_PEMencrypts inbound mail before R2 storage.
Never upload the Mailbridge private key.
npx wrangler r2 bucket create mailbridge-inbound
npx wrangler queues create mailbridge-inbound
npx wrangler deploy --dry-run
npx wrangler deployAdjust resource names to match the generated wrangler.toml.
- Enable Email Routing for the inbound domain.
- Route the desired addresses to the deployed Worker.
- Confirm the Worker has R2, Queue, and Email Service bindings.
- Ensure
NODE_APP_URLis publicly reachable over HTTPS. - If using a Tunnel, route the public hostname to Mailbridge port
3090.
The Worker stores ciphertext in R2, enqueues object references, retries temporary webhook failures, and deletes stored objects after successful or permanent processing.
Copyright (c) 2026 Voxvey Research LLC, a Helio company.