[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-79649":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},79649,"mailflare","hieunc229\u002Fmailflare","hieunc229","Email client with custom domain based on Cloudflare","",null,"TypeScript",263,39,23,0,1,14,149,11,63.81,"Other",false,"main",true,[26,27,28],"cloudflare","cloudflare-workers","email","2026-06-12 04:01:25","# Mailflare\n\nA self-hosted, AI-powered email inbox with custom domains, powered by Cloudflare\n\n[![Deploy to Cloudflare](https:\u002F\u002Fdeploy.workers.cloudflare.com\u002Fbutton)](https:\u002F\u002Fdeploy.workers.cloudflare.com\u002F?url=https:\u002F\u002Fgithub.com\u002Fhieunc229\u002Fmailflare)\n\n![](\u002Fscreenshot.png)\n\n\n### Roadmap\n\n- [x] Domain onboarding through Cloudflare, including inbound Email Routing DNS and sending DNS setup.\n- [x] Domain removal cleanup for linked Cloudflare routing rules and sending subdomain resources.\n- [x] Mailbox creation with automatic Cloudflare Email Routing rules.\n- [x] Mailbox management with a grid view, mailbox detail page, and editable display name.\n- [x] Inbox, sent, drafts, spam, and trash folders backed by a shared mail list component.\n- [x] Popup composer with autosaved drafts and draft resume from the drafts folder.\n- [x] Outbound send API, API keys, message read status, spam\u002Ftrash moves, and seeded demo data.\n- [x] Search, filtering, and richer mailbox\u002Ffolder counts.\n- [ ] Advanced routing rules for catch-all addresses, forwarding, reject\u002Fblock rules, and priorities.\n- [ ] Webhook management UI and delivery retry visibility.\n- [ ] Attachment support and richer compose formatting.\n\n#### Email agent\n\n- [ ] Message intelligence with summaries, intent classification, urgency scoring, and extracted entities.\n- [ ] Agent task queue for proposed replies, follow-ups, triage actions, and missing-information requests.\n- [ ] Human-approved actions for draft replies, folder moves, forwarding, contact creation, and webhook calls.\n- [ ] Agent rules for learned post-receipt policies such as prioritization, auto-triage, and reply templates.\n- [ ] Agent inbox view organized by action state, including needs reply, waiting on me, waiting on them, FYI, auto-handled, and needs approval.\n- [ ] Thread and contact memory for prior summaries, user preferences, relationship notes, commitments, and open loops.\n- [ ] Tool execution for trusted actions such as sending email, creating drafts, updating message status, calling webhooks, and creating contacts.\n\n## Domain API\n\nDomains are **not** dashboard-only. This app calls Cloudflare when you add\u002Fremove a domain:\n\n| Action | Cloudflare API |\n|--------|----------------|\n| List DNS \u002F status | `GET \u002Fzones\u002F{zone_id}\u002Femail\u002Frouting\u002Fdns` |\n| Enable inbound routing + MX\u002FSPF\u002FDKIM | `POST \u002Fzones\u002F{zone_id}\u002Femail\u002Frouting\u002Fdns` |\n| Disable routing | `DELETE \u002Fzones\u002F{zone_id}\u002Femail\u002Frouting\u002Fdns` |\n| Enable subdomain sending + DNS | `POST \u002Fzones\u002F{zone_id}\u002Femail\u002Fsending\u002Fsubdomains` |\n| Remove subdomain sending | `DELETE \u002Fzones\u002F{zone_id}\u002Femail\u002Fsending\u002Fsubdomains\u002F{tag}` |\n| Subdomain sending DNS records | `GET ...\u002Fsubdomains\u002F{tag}\u002Fdns` |\n\n**Requirements:** Prefer `CF_TOKEN` with Zone Read + Email Routing Edit + Email Sending Edit + Email Routing Rules Write (or broader). If you use a legacy Global API Key instead, set `CF_API_KEY` and `CF_EMAIL`. The hostname must be the account's Cloudflare zone apex or a subdomain under that zone. Root-domain sending uses the Cloudflare Email Service binding, while subdomain sending can also provision the sending-subdomain DNS records. Mailbox creation creates a Cloudflare Email Routing rule that sends that address to `CF_EMAIL_WORKER_NAME` (`mailflare` by default).\n\nApp routes:\n\n- `GET\u002FPOST \u002Fapi\u002Fdomains` — list \u002F add (calls Cloudflare)\n- `GET\u002FDELETE \u002Fapi\u002Fdomains\u002F[id]` — get \u002F remove (disables routing & sending on CF)\n- `GET \u002Fapi\u002Fdomains\u002F[id]\u002Fdns` — routing + sending DNS snapshot\n\n## Setup\n\n```bash\ncp .dev.vars.example .dev.vars\n# Add CF_TOKEN and optionally CF_ACCOUNT_ID.\n# For a legacy Global API Key, use CF_API_KEY + CF_EMAIL instead.\n\nnpm install\nnpm run db:migrate:local\nnpm run dev\n```\n\nRegister at `\u002Fregister`, complete `\u002Fonboarding`, or seed dev data:\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fseed\n```\n\n## Deploy\n\n### One-click Cloudflare deploy\n\n\n[![Deploy to Cloudflare](https:\u002F\u002Fdeploy.workers.cloudflare.com\u002Fbutton)](https:\u002F\u002Fdeploy.workers.cloudflare.com\u002F?url=https:\u002F\u002Fgithub.com\u002Fhieunc229\u002Fmailflare)\n\nPublish this repository to GitHub, then replace `hieunc229\u002Fmailflare` in the button at the top of this README with the public repository path.\n\nThe deploy flow reads `wrangler.jsonc`, provisions the Worker bindings, prompts for values from `.dev.vars.example`, runs D1 migrations, builds the OpenNext Worker, and deploys it.\n\nKeep `wrangler.jsonc` committed. Cloudflare's deploy button uses it to detect the Worker entrypoint and required bindings. Do not commit `.dev.vars`; deploy-time secrets should be entered through Cloudflare's setup flow or set locally in `.dev.vars`.\n\nRequired setup values:\n\n- `CF_TOKEN` — runtime scoped Cloudflare API token with Zone Read, Email Routing Edit, Email Sending Edit, and Email Routing Rules Write. This is separate from Cloudflare's deploy\u002Fbuild token; Cloudflare does not automatically expose the deploy token to this app.\n- `CF_ACCOUNT_ID` — optional unless your token can access multiple accounts.\n- `CF_EMAIL_WORKER_NAME` — must match the Worker name in `wrangler.jsonc`; default is `mailflare`.\n\nIf you rename the Worker, also update related literal resource names in `wrangler.jsonc`: `name`, `services[].service` for `WORKER_SELF_REFERENCE`, `CF_EMAIL_WORKER_NAME`, and any D1\u002FR2\u002FQueue names you want renamed. Cloudflare service bindings require the target Worker name to exist exactly; they cannot currently reference `name` dynamically.\n\nAfter deployment, route inbound mail to the Worker in Cloudflare Email Routing.\n\n### Cloudflare token troubleshooting\n\nIf onboarding fails with `Cloudflare API 403 ... code 9109: Invalid access token`, Cloudflare rejected the credential before checking domain permissions.\n\nThe Deploy to Cloudflare flow can authenticate and deploy the Worker, but it does not create a runtime `CF_TOKEN` for Mailflare's onboarding API calls. Create `CF_TOKEN` manually from Cloudflare dashboard user API tokens and enter it as a deploy secret\u002Fvariable.\n\nVerify the token:\n\n```bash\ncurl \"https:\u002F\u002Fapi.cloudflare.com\u002Fclient\u002Fv4\u002Fuser\u002Ftokens\u002Fverify\" \\\n  -H \"Authorization: Bearer \u003CCF_TOKEN>\"\n```\n\nThe response should include `\"success\": true` and `\"status\": \"active\"`. In `.dev.vars` or deploy settings, set `CF_TOKEN` to the token secret value only. Do not include the word `Bearer`, do not use the token ID, and do not put a Global API Key in `CF_TOKEN`. For a Global API Key, set both `CF_EMAIL` and `CF_API_KEY` instead.\n\nAlso check whether the token has an expiration, a `not_before` time, or client IP restrictions. If you changed deploy variables in Cloudflare, redeploy so the Worker receives the new values.\n\n### Manual deploy\n\n```bash\nnpm run deploy\n```\n\n`npm run deploy` applies remote D1 migrations before deploying. Cloudflare's deploy button can auto-provision the D1 database, R2 bucket, and queues declared in `wrangler.jsonc`; for manual deployments, create or update those bindings in Cloudflare if they do not already exist.\n","Mailflare 是一个基于 Cloudflare 的自托管电子邮件客户端，支持自定义域名。该项目利用 Cloudflare Workers 和 TypeScript 构建，提供了一系列核心功能，包括通过 Cloudflare 进行域名的导入和移除、邮箱创建与管理、邮件收发及分类存储等。此外，Mailflare 计划集成 AI 技术以增强邮件处理能力，如自动摘要、意图识别等功能。此项目适用于需要对邮件服务有完全控制权，并希望通过 Cloudflare 网络提高安全性和性能的企业或个人用户。",2,"2026-06-11 03:58:12","CREATED_QUERY"]