{"id":22771277,"url":"https://github.com/leafyeexyz/mailbox","last_synced_at":"2025-04-15T05:29:39.199Z","repository":{"id":250971331,"uuid":"835664038","full_name":"LeafYeeXYZ/MailBox","owner":"LeafYeeXYZ","description":"Serverless, free and custom domain email server using Cloudflare Mail Workers for receiving and Resend for sending / 零成本、无服务器、自定义域名邮件收发服务, 基于 Cloudflare Mail Workers (收) 和 Resend (发)","archived":false,"fork":false,"pushed_at":"2025-01-23T06:54:05.000Z","size":671,"stargazers_count":15,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T16:21:22.204Z","etag":null,"topics":["ant-design","antd","antdesign","cloudflare","cloudflare-workers","email","email-sender","javascript","nextjs","react","react-markdown","reactjs","resend","serverless","typescript","vercel"],"latest_commit_sha":null,"homepage":"https://mail.leafyee.xyz","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeafYeeXYZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-30T09:36:53.000Z","updated_at":"2025-03-16T04:31:41.000Z","dependencies_parsed_at":"2024-08-21T09:45:38.760Z","dependency_job_id":"0cd40d07-f1ba-4e86-90b9-242c54445272","html_url":"https://github.com/LeafYeeXYZ/MailBox","commit_stats":null,"previous_names":["leafyeexyz/mailbox"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeafYeeXYZ%2FMailBox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeafYeeXYZ%2FMailBox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeafYeeXYZ%2FMailBox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeafYeeXYZ%2FMailBox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeafYeeXYZ","download_url":"https://codeload.github.com/LeafYeeXYZ/MailBox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249013898,"owners_count":21198479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ant-design","antd","antdesign","cloudflare","cloudflare-workers","email","email-sender","javascript","nextjs","react","react-markdown","reactjs","resend","serverless","typescript","vercel"],"created_at":"2024-12-11T16:13:02.755Z","updated_at":"2025-04-15T05:29:39.177Z","avatar_url":"https://github.com/LeafYeeXYZ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MailBox\nMailBox is a web application that allows you to send and receive emails serverlessly and costlessly with your custom domain.\n\nMailBox 是一个允许你使用自定义域名进行免费邮件收发的 Serverless 网页应用\n\n![](./README.png)\n\n| Demo User | Demo Password |\n|:---------:|:-------------:|\n|demo@o0-0o.icu|123456|\n\n## Usage / 部署方法\n### 1 Get MongoDB Atlas URI\n\nCreate a new project in [MongoDB Atlas](https://www.mongodb.com/) and get the URI of the cluster. The URI should be like `mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@xxxxxxx.xxxxxxxx.xxxxx?xxxx=xxxx\u0026xxxx=xxxx`, remember to replace `\u003cusername\u003e` and `\u003cpassword\u003e` with your own.\n\n\u003e 获取 [MongoDB Atlas](https://www.mongodb.com/) 的数据库 URI: 在 [MongoDB Atlas](https://www.mongodb.com/) 中创建一个新的项目并获取集群的 URI。URI 应该类似于 `mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@xxxxxxx.xxxxxxxx.xxxxx?xxxx=xxxx\u0026xxxx=xxxx`，请记得将 `\u003cusername\u003e` 和 `\u003cpassword\u003e` 替换为你自己的\n\n### 2 Get Resend API Key\n\nCreate a new project in [Resend](https://resend.com/), and create a new API key. Note that the domain you use in Resend should be the same as the domain you use in Cloudflare.\n\n\u003e 获取 [Resend](https://resend.com/) 的 API key: 在 [Resend](https://resend.com/) 中创建一个新的项目并创建一个新的 API key。请注意你在 Resend 中使用的域名应该和你在 Cloudflare 中使用的域名相同\n\n### 3 Deploy to Vercel\n\nDeploy this `Next.js` project to `Vercel` with the following environment variables in `Vercel` or `.env` file.\n\n\u003e 部署到 [Vercel](https://vercel.com/): 在 `Vercel` 中部署这个 `Next.js` 项目，并在 `Vercel` 或 `.env` 文件中设置以下环境变量\n\n| Variable | Description | Default | Required |\n|:--------:|:-----------:|:-------:|:--------:|\n| `RESEND_API_KEY` | API key of Resend | | Yes |\n| `MONGODB_URI` | URI of MongoDB Atlas | | Yes |\n| `PEER_AUTH_KEY` | For authenticating between Cloudflare Workers and Next.js | | Yes |\n| `NEXT_PUBLIC_MAIL_SERVER` | The domain of your mail server, e.g. `mail.example.com` | | Yes |\n| `REGISTRY_KEY` | If set, only users with this key can register | | |\n| `NEXT_PUBLIC_REGISTRY_SET` | If `REGISTRY_KEY` is set, this should be set to `true` | | |\n\n### 4 Config Workers Environment Variables\n\nCreate `/workers/wrangler.toml` and add the following content. Remember to replace `\u003cYOUR_NEXTJS_PROJECT_DOMAIN\u003e` and `\u003cYOUR_PEER_AUTH_KEY\u003e` with your own.\n\n\u003e 设置 Cloudflare Workers 的环境变量: 创建 `/workers/wrangler.toml` 并添加以下内容, 请记得将 `\u003cYOUR_NEXTJS_PROJECT_DOMAIN\u003e` 和 `\u003cYOUR_PEER_AUTH_KEY\u003e` 替换为你自己的\n\n```toml\n#:schema node_modules/wrangler/config-schema.json\nname = \"mail\"\nmain = \"src/index.ts\"\ncompatibility_date = \"2024-08-01\"\ncompatibility_flags = [\"nodejs_compat\"]\n\n[vars]\nNEXT_ENDPOINT = \"https://\u003cYOUR_NEXTJS_PROJECT_DOMAIN\u003e/api/receive\"\nPEER_AUTH_KEY = \"\u003cYOUR_PEER_AUTH_KEY\u003e\"\n\n[observability]\nenabled = true\n```\n\n### 5 Deploy Workers\n\nRun the following command to deploy the workers.\n\n\u003e 部署 Cloudflare Workers: 运行以下命令部署 Cloudflare Workers\n\n```bash\ncd ./workers # Change to workers directory to Workers project\nbun install # Install dependencies\nbunx wrangler login # Login to Cloudflare\nbun run deploy # Deploy the workers\n```\n\n### 6 Config Cloudflare Mail route\n\n1. Go to your domain's Cloudflare dashboard.\n2. Click on the `Email` tab.\n3. Click on `Email Routing`.\n4. Click on `Routing Rules`.\n5. Set `Catch All` to forward all mail to the workers you just deployed.\n\n\u003e 设置 Cloudflare 的邮件路由: 进入你的域名的 Cloudflare 控制台 -\u003e 点击 `电子邮件` -\u003e 点击 `邮件路由` -\u003e 点击 `路由规则` -\u003e 设置 `Catch All` 为转发所有邮件到你刚刚部署的 Worker\n\n## License\n[GPL-3.0](./LICENSE)\n\n## TODO\n- [x] 身份验证和用户数据存储 (MongoDB)\n- [x] 接收邮件功能 (Cloudflare Mail Workers -\u003e Next.js -\u003e MongoDB)\n- [x] 注册功能 (服务端注册条件控制)\n- [x] 单条邮件阅读组件\n- [x] 发送邮件功能 (Resend)\n- [x] 支持 Markdown 写邮件 (Marked)\n- [x] 已发送邮件页面\n- [x] 个人资料页面 (记得游客账户不能修改)\n- [x] 夜间模式\n- [ ] 找回密码功能 (向备用邮箱发送验证码)\n- [ ] AI 总结邮件内容生成邮件摘要 (Cloudflare Workers AI)\n- [ ] 附件支持\n- [ ] 邮件收藏\n- [ ] 邮件提醒 (Resend Webhook -\u003e Cloudflare Queues -\u003e Device)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafyeexyz%2Fmailbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafyeexyz%2Fmailbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafyeexyz%2Fmailbox/lists"}