Bruce McLachlanandClaude Opus 5 374ad89bb0 feat(mailboxes): add mailbox deletion to the settings UI
The DELETE /api/mailboxes/[id] endpoint already existed but nothing in the
UI called it, so a mailbox could be created but never removed.

Add a "Danger zone" card to the mailbox settings page with a confirmation
prompt, consistent with the existing destructive-action pattern used on the
backups page, redirecting back to the mailbox list on success.

Also fix a cleanup gap in the endpoint itself: creating a mailbox provisions
a Cloudflare Email Routing rule via ensureMailboxDomainRouting, but deleting
one only removed the database row, orphaning the routing rule so mail kept
being routed to the Worker for an address that no longer existed. Add the
mirrored removeMailboxDomainRouting and call it before the row is deleted,
returning 502 without deleting if the Cloudflare call fails so the database
and Cloudflare cannot drift apart.

The rule-matching predicate used by ensureEmailRoutingRuleToWorker is
extracted into isWorkerRouteForAddress and reused by the new
deleteEmailRoutingRuleForAddress, so both sides match rules identically.
Address selection reuses getMailboxDomainAddresses, which already excludes
domains claimed by another mailbox with the same local part, so deleting a
mailbox cannot remove another mailbox's routing rule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-01 00:48:30 +02:00
2026-05-26 08:19:09 +07:00
2026-08-31 17:30:11 +07:00
2026-05-26 10:56:49 +07:00
2026-08-30 20:54:36 +07:00
2026-05-26 08:19:09 +07:00
2026-05-26 08:19:09 +07:00
2026-05-26 08:19:09 +07:00
2026-08-25 11:41:23 +07:00
2026-05-26 08:19:09 +07:00
2026-05-26 08:26:17 +07:00
2026-08-25 11:15:20 +07:00
2026-05-26 08:19:09 +07:00
2026-06-18 23:24:27 +07:00
2026-05-26 08:19:09 +07:00
2026-08-31 17:30:11 +07:00
2026-05-27 09:57:54 +07:00
2026-06-18 23:24:27 +07:00
2026-05-26 08:58:47 +07:00
2026-08-30 20:54:36 +07:00
2026-06-18 23:24:27 +07:00
2026-06-18 23:24:27 +07:00

Mailflare

Mailflare

Mailflare is a self-hosted email inbox for custom domains, built on Cloudflare.

Deploy to Cloudflare

Mailflare inbox

What you can do

  • Connect domains and set up Cloudflare Email Routing from the dashboard.
  • Create personal and shared mailboxes with delegated access.
  • Send and receive email with attachments, rich formatting, signatures, and automatic replies.
  • Organize mail with search, custom folders, stars, snoozing, archive, spam, and trash.
  • Create routing rules to store, forward, reject, or categorize incoming messages.
  • Get real-time inbox updates and new-message notifications.
  • Import and export mail, manage contacts, and block unwanted senders.
  • Manage accounts, permissions, API keys, webhooks, audit logs, and database backups.

How it works

Mailflare runs in your Cloudflare account. Email Routing delivers incoming messages to the app, while Cloudflare's email service handles outgoing messages. Your mail data stays in your own D1 database and attachments are stored in your own R2 bucket.

How much does it cost?

You can setup Mailflare and receive email for free

A Paid Worker plan ($5/month) is required to send email (and it's recommend to have a smooth experience)

Deploy

The easiest way to get started is with the Deploy to Cloudflare button above. You will need:

  • A Cloudflare account.
  • A domain managed by Cloudflare.
  • A Cloudflare API token that Mailflare can use to configure email routing.

After deployment, open your Mailflare URL and follow the first-run setup. The setup checks your Cloudflare configuration, creates the initial account, and helps you connect your first domain.

See the deployment guide for required permissions, manual deployment, backups, updates, and custom Worker names.

Local development

cp .dev.vars.example .dev.vars
npm install
npm run db:migrate:local
npm run dev

Add your Cloudflare credentials to .dev.vars, then open http://localhost:3000. For sample local data, run npm run db:seed while the development server is running.

Documentation

License

See LICENSE.

S
Description
Email for professionals and teams
https://mailflare.co
Readme AGPL-3.0
70 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 92.6%
JavaScript 6.7%
CSS 0.6%