@zintrust/cloudflare-email-proxy
v2.4.1
Published
Cloudflare email proxy package for ZinTrust.
Maintainers
Readme
@zintrust/cloudflare-email-proxy
Cloudflare Worker service that exposes a small HTTPS API for Cloudflare Email Routing sends.
Docs: https://zintrust.com/mail
This is intended for server-to-server use when a ZinTrust app runs outside Cloudflare Workers but still wants to use the built-in MAIL_DRIVER=cl or MAIL_DRIVER=cloudflare path.
Endpoint
All requests are POST and require signed request headers.
/zin/mail/cloudflare/send→{ binding?, message }→{ ok: true, messageId? }
Required bindings
SEND_EMAILsend_email binding
If your binding name is not SEND_EMAIL, set Worker var MAIL_CLOUDFLARE_BINDING or pass binding in the signed payload.
Optional but recommended:
ZT_NONCESKV binding for replay protection
Required secrets / vars
Secret:
MAIL_CLOUDFLARE_PROXY_SECRETshared signing secret used to verify requestsAPP_KEYfallback shared signing secret ifMAIL_CLOUDFLARE_PROXY_SECRETis not set
Optional vars:
ZT_PROXY_SIGNING_WINDOW_MSdefault60000ZT_MAX_BODY_BYTESdefault131072
Deploy
From this package directory:
wrangler deploySet secrets:
wrangler secret put MAIL_CLOUDFLARE_PROXY_SECRETUse from ZinTrust
Configure your app:
MAIL_DRIVER=clMAIL_CLOUDFLARE_PROXY_URL=https://<your-worker-host>MAIL_CLOUDFLARE_PROXY_KEY_ID=k1MAIL_CLOUDFLARE_PROXY_SECRET=super-secret-shared-keyMAIL_CLOUDFLARE_BINDING=SEND_EMAILif needed
Then use Mail.send(...) as normal.
License
This package and its dependencies are MIT licensed, permitting free commercial use.
