Mailflare
A self-hosted, AI-powered email inbox with custom domains, built on Cloudflare Workers with Email Routing and one-click deployment.
At a Glance
Free and open-source self-hosted email inbox deployable to Cloudflare Workers.
Engagement
Available On
Alternatives
Listed Jun 2026
About Mailflare
Mailflare is an open-source, self-hosted email client that runs entirely on Cloudflare infrastructure, letting users manage custom-domain inboxes without relying on third-party email providers. Built in TypeScript, it deploys as a Cloudflare Worker and integrates directly with Cloudflare Email Routing and Email Sending APIs to handle both inbound and outbound mail. The project was created by GitHub user hieunc229 and has accumulated 216 stars and 28 forks since its initial release in May 2026.
What It Is
Mailflare is a self-hosted email inbox application that uses Cloudflare's email infrastructure as its backbone. It falls into the category of bring-your-own-infrastructure email clients: rather than routing mail through a SaaS provider, it provisions Cloudflare Email Routing rules, MX/SPF/DKIM DNS records, and sending subdomains directly via the Cloudflare API when you add a domain. The app is built with Next.js (via OpenNext for Workers), uses Cloudflare D1 as its database, and exposes a REST API for domain and mailbox management.
Core Mailbox Features
The completed roadmap items cover the full day-to-day email workflow:
- Folder support: Inbox, Sent, Drafts, Spam, and Trash, all backed by a shared mail list component
- Composer: Popup composer with autosaved drafts and draft resume from the Drafts folder
- Mailbox management: Grid view, mailbox detail page, and editable display names
- Outbound send API with API key support, message read status, spam/trash moves, and seeded demo data
- Search and filtering with richer mailbox and folder counts
- Domain onboarding: Automated Cloudflare DNS setup for inbound routing and outbound sending, with cleanup on domain removal
Planned Email Agent Layer
A significant portion of the roadmap is dedicated to an AI email agent that has not yet shipped. The planned agent capabilities include message intelligence (summaries, intent classification, urgency scoring, entity extraction), a task queue for proposed replies and triage actions, human-approved actions for draft replies and folder moves, and thread/contact memory for relationship notes and open loops. The agent inbox view is designed around action states such as "needs reply," "waiting on me," and "auto-handled." Tool execution for trusted actions like sending email, creating drafts, and calling webhooks is also planned.
Deployment Model
Mailflare is designed for one-click deployment to Cloudflare via the "Deploy to Cloudflare" button, which reads wrangler.jsonc, provisions Worker bindings (D1, R2, Queues), prompts for secrets, runs D1 migrations, and deploys the OpenNext Worker. Manual deployment is also supported via npm run deploy. The app requires a scoped Cloudflare API token (CF_TOKEN) with Zone Read, Email Routing Edit, Email Sending Edit, and Email Routing Rules Write permissions — separate from the deploy token Cloudflare uses during the button flow.
Current Status
The repository was created on May 26, 2026 and last updated on June 1, 2026, indicating very recent and active development. The project is licensed under a non-standard "Other (NOASSERTION)" license. Core inbox functionality is complete and deployable; the AI email agent layer is entirely on the roadmap and not yet implemented. Attachment support and advanced routing rules (catch-all, forwarding, reject/block) are also still pending.
Community Discussions
Be the first to start a conversation about Mailflare
Share your experience with Mailflare, ask questions, or help others learn from your insights.
Pricing
Open Source
Free and open-source self-hosted email inbox deployable to Cloudflare Workers.
- Custom domain email hosting
- Inbound and outbound email routing
- Automated DNS setup via Cloudflare API
- Inbox, Sent, Drafts, Spam, Trash folders
- Popup composer with autosaved drafts
Capabilities
Key Features
- Custom domain email hosting via Cloudflare
- Inbound and outbound email routing
- Automated MX/SPF/DKIM DNS setup
- Inbox, Sent, Drafts, Spam, and Trash folders
- Popup composer with autosaved drafts
- Mailbox grid view and management
- Outbound send API with API key support
- Message read status tracking
- Search and filtering
- One-click Cloudflare deployment
- D1 database backend
- REST API for domain and mailbox management
- Seeded demo data support