Skip to content

Testing and Operations

Ra's al Ghul edited this page Aug 9, 2026 · 1 revision

Testing and Operations

Project verification

npm test
npm audit --omit=dev
npx wrangler deploy --dry-run

For container changes:

docker compose up -d --build
docker compose ps
docker logs -f mail-bridge

Inbound checks

  1. Confirm GET /health returns OK.
  2. Deploy the Worker and verify its R2 and Queue bindings.
  3. Send a test message through Cloudflare Email Routing.
  4. Confirm the Worker stores and queues the encrypted object.
  5. Confirm Mailbridge decrypts, scans, and delivers it locally.
  6. Verify the R2 object is deleted after successful delivery.

Outbound relay checks

Use swaks only after the relay CIDR and TLS policy are configured:

swaks \
  --server 127.0.0.1 \
  --port 2525 \
  --from postmaster@example.com \
  --to recipient@example.net \
  --header "Subject: Mailbridge outbound test"

Add the appropriate STARTTLS options when TLS is required.

Logs and audit data

  • Application and relay diagnostics are written to container stdout/stderr.
  • data/mailbridge.db contains audit events.
  • secrets/secrets.db contains retry-queue secret material and must remain private.
  • Encrypted retry files live under data/queue/.

Avoid verbose logging of raw messages or secret values. Audit retention is controlled by AUDIT_LOG_RETENTION_DAYS.

Clone this wiki locally