← Back to InboxFly

InboxFly Documentation

Complete guide for the self-hosted edition (open source · MIT): from local trials to production, daily management and advanced setup.

Contents

  1. Quick start (local)
  2. Deploy to Cloudflare
  3. First-run wizard
  4. Enable mail routing
  5. Destination addresses
  6. Routing rules
  7. Daily management
  8. Storage & quotas
  9. Security
  10. Themes / language / PWA
  11. Known limits
  12. Uninstall & cleanup

1. Quick start locally (3 min)

Local environments cannot receive real mail, but you can exercise the full panel and pipeline (seed data via "Simulate"):

git clone https://github.com/xusteve/inboxfly.email
cd inboxfly && npm install
npm run dev          # starts dev server on http://localhost:8788

2. Deploy to Cloudflare

Deploy to Cloudflare

npx wrangler login
npx wrangler deploy           # Worker + static panel + D1 + R2 + KV + Cron
npx wrangler secret put SETUP_TOKEN    # setup token for the first-run wizard

3. First-run wizard (5 steps)

Open the panel URL after deploying and follow the wizard. Every step explains "why" and "risks":

  1. Verify deployer identity: enter the SETUP_TOKEN (appears only in deploy output, invalidated after setup) to prevent panel takeover.
  2. Create admin credentials: username + ≥8-char password (PBKDF2-hashed, non-recoverable).
  3. Enable Email Routing: skip locally; in production follow the guide in the Cloudflare dashboard (next section).
  4. Add a destination address: enter your real mailbox (e.g. Gmail) and complete Cloudflare confirmation.
  5. Create the first rule: defaults to *@yourdomain → forward → verified destination, and sets it as the fail-open fallback.

4. Enable mail routing (per domain)

Three things must be in place: the Email Routing master switch, catch-all pointing at the Worker, and a verified destination. Two ways:

Option A · Panel automation (recommended)

After saving a CF API Token in Settings → Domains, an "Enable forwarding" button appears per domain. The panel automatically: detects MX conflicts (lists them for per-record confirmation) → enables Email Routing → adds recommended MX/SPF DNS records → points catch-all at the InboxFly Worker.

ScopePermission groupAccessUsed for
ZoneZoneReadDomain discovery & sync
ZoneZone SettingsRead + EditEmail Routing status & enable
ZoneDNSRead + EditMX conflict check, add MX/SPF records
ZoneEmail Routing RulesRead + EditCatch-all → Worker, native rule import
AccountEmail Routing AddressesRead + EditDestination addresses: add & verified-status sync
Note: enabling/querying Email Routing requires the "Zone Settings" group, not "Email Routing Rules" — tick both or you get an Authentication error. The panel never calls the Workers / D1 / KV / R2 APIs (runtime bindings) — those permissions are not needed.

Option B · Manual in Cloudflare dashboard

Dashboard → your zone → Email → Email Routing → Enable (confirm MX replacement) → Catch-all address → action "Send to a Worker" → pick inboxfly. Refresh the panel afterwards; all domain health checks turn green.

5. Destination addresses

6. Routing rules

The rules page mirrors Cloudflare's native routing page: one unified rules table with a fixed "📌 Catch-all" fallback row at the end.

Creating a rule

Evaluation order

Exact rules → catch-all rules, sorted within group, first match wins. Unmatched mail goes to the Catch-all row (forward to default / bounce / drop).

Important: do not create routing rules manually in the Cloudflare dashboard — native rules take precedence over catch-all and bypass InboxFly (no copies, no stats). Import existing native rules via Settings → Domains.

7. Daily management

8. Storage & quotas

9. Security

10. Themes / language / PWA

11. Known limits

12. Uninstall & cleanup

  1. Revoke the panel's CF API Token (dashboard → API Tokens) — the forwarding pipeline runs independently in your account and keeps working; panel automation degrades.
  2. Stop forwarding: dashboard → Email Routing → disable Catch-all or the whole service.
  3. Delete resources: Workers → inboxfly; D1 → inboxfly; R2 → inboxfly; KV → the namespace.
If something is not covered here, please open a GitHub issue.
© 2026 InboxFly — open source under MIT