本文来源:https://mp.weixin.qq.com/s/ZtMGkJSu7OWblONv_4i3WQ
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。
我以前对域名邮箱的理解很土。
就是那种 name@yourdomain.com,看起来像公司老板、独立开发者,或者某个很会折腾的人。普通人要它干嘛?发简历吗?装一下吗?
后来我慢慢发现,这东西最值钱的地方不是“专业感”。
是边界感。
你用一个主力邮箱注册购物网站、 AI 工具、网盘、论坛、 newsletter 、临时下载站。三个月后,它开始收到奇怪的促销、验证码、海外广告,甚至一些你根本没见过的平台通知。
那一刻很烦。
更烦的是,你根本不知道是谁把你的邮箱弄脏了。
域名邮箱的妙处就在这里:你有一个自己的域名,就等于有了一串可控的邮箱身份。比如 notion@你的域名、shop@你的域名、test@你的域名。哪里泄露,一眼能看出来。想丢掉,也不心疼。
这不是高级玩法。
这是普通人的数字防尘罩。
真正的痛点:不是邮箱不够用,是身份太好追踪
很多人以为“我有 Gmail / Outlook / QQ 邮箱就够了”。够用,当然够用。能收验证码,能发文件,能登录各种服务。
但它也太集中。
一个邮箱用了七八年,绑定支付、社交、网盘、 GitHub 、 AI 平台,像一串钥匙全挂在同一个钥匙扣上。平时方便。丢的时候,很想骂人。
域名邮箱解决的是三个问题。
第一,隔离身份。不同网站用不同前缀,减少主力邮箱暴露。
第二,追踪泄露。比如你只在某个论坛用过 forum@你的域名,后来这个地址开始收到博彩广告,不用猜了,锅就在那儿。
第三,个人品牌。me@你的域名 这种邮箱,在商务沟通、独立项目、个人网站上,确实比一串随机数字邮箱更稳一点。别笑,很多人的第一印象,就是从一个邮箱后缀开始的。
以前搭这套东西挺麻烦:要么买第三方域名邮箱服务,要么自己租服务器、配邮件服务、处理安全和送达率。一堆 DNS 、 MX 、 SPF 、 DKIM ,看着就头皮发紧。现在有个更轻的方案:Cloudflare + Cloud Mail + Resend。
不买服务器。
不自己维护邮件系统。
对普通人来说,这个组合已经够用了。
这套方案为什么能做到“0 服务器”
Cloud Mail 是一个开源项目,官方说明里写得很直接:它运行在 Cloudflare Workers 上,使用 Cloudflare KV 、 D1 、 R2 等服务,发信集成 Resend 。它不是让你在 VPS 上跑传统邮箱服务器,而是把邮箱后台拆成几块,借 Cloudflare 的边缘平台跑起来。
这个设计有点聪明。
Cloudflare Email Routing 负责收信入口。 Cloudflare 文档里也提到 Catch-all 规则:开启后,发到你域名下的所有邮箱地址都会被同一个目的地处理,哪怕本地部分拼错也会被接住。
Workers 像小型处理器。 D1 像登记簿。 KV 或 R2 像仓库。 Resend 负责发信。 Resend 当前免费计划是每月 3000 封、每天 100 封,对个人日常回邮件、收验证码、注册服务来说,基本够用。别拿它群发营销邮件,那是另一个物种,容易翻车。
嗯,就这套。
你可以把它理解成一个免费小邮局: Cloudflare 给场地和柜台, Cloud Mail 给管理系统, Resend 当外部邮差。
当然,免费不等于无限。 Cloudflare Workers 免费计划有每天请求数限制, KV 免费层也有存储和写入限制。你的口播稿里提到 KV 默认 1GB 、每天 1000 次写入,这对纯文本邮件很宽裕;但如果天天收大附件,迟早要上 R2 或付费方案。
免费方案最怕的不是限制。
最怕你不知道限制在哪。
搭建时:抓住这 5 个动作就行
如果把整套部署写成教程,会很长: Fork 仓库、建 Worker 、配环境变量、建 D1 、建 KV 、绑路由、初始化、注册管理员、接 Resend 、配 Webhook……
看着像一碗面里有 17 种调料。
其实主线只有 5 个动作。
第一步,准备域名。域名买在哪里都行,关键是把 DNS 托管到 Cloudflare 。几块钱一年的冷门后缀也能玩,先跑通,别摆阔。
第二步,把 Cloud Mail 部署成 Worker 。在 GitHub 上 Fork Cloud Mail 项目,再到 Cloudflare Workers & Pages 里从 GitHub 导入。你的素材里提到路径要填 mail-worker,这个细节很容易漏。漏了就会很烦。
第三步,填 3 个环境变量。DOMAIN 填你的域名数组,比如 ["example.com"]。admin 填管理员邮箱,比如 admin@example.com。JWT_SECRET 填初始化用的密钥,越长越乱越好,别用 testtesttest 当正式密码。演示可以,真用不行。
这一步很像给房子装门牌和门锁。门牌错了,邮件找不到家;门锁太烂,别人迟早进来。
第四步,建 D1 和 KV ,再绑定到 Worker 。变量名别乱改。 KV 绑定通常就叫 kv, D1 绑定通常叫 db。很多小白部署失败,不是代码不会,而是大小写、路径、变量名这种小钉子扎脚。
第五步,把 Email Routing 的 Catch-all 指到 Worker 。Cloudflare Email Routing 开启后,让所有发往这个域名的邮件进入你的 Cloud Mail Worker 。这样 abc@你的域名、shop@你的域名 都能被接住。
接着访问:
https://你的邮箱后台域名/api/init/你的JWT_SECRET看到 success,数据库初始化完成。
删掉 URL 后面那串尾巴,打开后台,用管理员邮箱注册。到这一步,收信基本就通了。
能收不等于能发, Resend 是最容易漏掉的那块
很多人部署到这里会有一个错觉:后台能打开,测试邮件能收到,完事。
不对。
收信和发信是两件事。
Cloudflare Email Routing 主要解决收信路由。你想从 admin@你的域名 正常回复别人,还需要一个发信服务。 Cloud Mail 这套方案里,常见做法是接 Resend 。
Resend 的逻辑不复杂:
1.注册 Resend 账号。2.添加你的域名。3.完成 DNS 验证。4.创建 API Key 。5.在 Cloud Mail 后台填入 Resend Token 。6.配 Webhook ,让送达、退信、失败这些状态回传到后台。
这里有两个细节,认真一点。
第一, API Key 只显示一次。生成后立刻保存,别手抖关掉。关掉再找,没了,只能重新建。
第二, Webhook 事件不要乱勾。退信、投诉、送达、延迟、失败够了。opened、clicked 这种追踪打开和点击的事件,如果是个人日常邮件,没必要。你给朋友发封邮件还偷偷追踪别人有没有打开,味儿不对。
这不是技术洁癖。
这是边界。
我们搭域名邮箱,是为了保护自己的隐私,不是顺手制造另一个隐私问题。别把工具用歪了。
真正值得做的,不是薅羊毛,是给自己留后路
很多教程会把域名邮箱讲成“无限小号”“注册福利神器”。这话能吸引点击,也容易把人带偏。
你当然可以用不同邮箱前缀注册不同服务,但如果核心目的变成钻平台规则的空子,那这个工具就变得很油腻。一个好工具,最好的用法通常不是占便宜,而是减少损耗。
主力邮箱少泄露一点。临时网站少污染一点。个人品牌看起来认真一点。哪天平台账号出问题,你还能靠自己的域名邮箱保持身份连续。
这才是它的价值。
我越来越觉得,普通人应该拥有三样数字资产:一个自己的域名,一个干净的主力邮箱,一个能长期沉淀内容的地方。它们都不炫,但很有用。
像家里的备用钥匙。
平时你感觉不到它的存在,真出事的时候,你会庆幸自己早就配了一把。
参考资料
1.Cloud Mail GitHub 项目: https://github.com/maillab/cloud-mail2.Cloudflare Email Routing 文档: https://developers.cloudflare.com/email-service/configuration/email-routing-addresses/3.Cloudflare Workers Limits : https://developers.cloudflare.com/workers/platform/limits/4.Cloudflare Workers KV 免费层说明: https://blog.cloudflare.com/workers-kv-free-tier/5.Resend Pricing : https://resend.com/pricing6.Cloudflare Workers 使用 Resend 发邮件教程: https://developers.cloudflare.com/workers/tutorials/send-emails-with-resend/
Source: https://mp.weixin.qq.com/s/ZtMGkJSu7OWblONv_4i3WQ If there are any copyright issues, please contact us at: 13951431913#139.com or submit a comment on the right.
I used to think domain email was just for show.
You know, name@yourdomain.com — that’s what company bosses, indie devs, or people who like messing with tech use. What do regular folks need it for? Pretending they’re serious? Sending resumes?
Then I figured it out: the real value isn’t “looking professional.”
It’s about boundaries.
You register for shopping sites, AI tools, cloud storage, forums, and newsletters with your main email. Three months later, it’s flooded with junk — promo emails, random verification codes, even ads from places you’ve never heard of.
That’s annoying.
Even more annoying? You can’t tell which site leaked your address.
That’s where domain email shines. With your own domain, you get a set of controlled identities — like notion@mydomain, shop@mydomain, dev@mydomain. If one gets spammy, you know exactly who to blame. And if you need to ditch it, no big deal.
This isn’t advanced tech.
It’s digital dust protection for normal people.
The real problem: it’s not about running out of emails — it’s about identity tracking.
Most people think, “I have Gmail/Outlook/QQ, that’s enough.” And yeah, it works — you can get codes, send files, log in.
But it’s all too centralized.
One email used for 8+ years, tied to payments, social media, storage, GitHub, AI — like having all your keys on one ring. Convenient? Sure. Lose it, and you’re screwed.
Domain email fixes three things:
First, segmentation. Use different prefixes for different sites, don’t expose your main address everywhere.
Second, leak tracing. If ads start coming to forum@mydomain, you know which forum sold you out.
Third, branding. me@mydomain just looks cleaner than a random string of numbers. People notice that — even if they say they don’t care.
Used to be, setting this up meant either paying for a service or hosting it yourself — which meant DNS, MX records, SPF, DKIM, and praying for delivery. A mess. But now there’s a lighter option: Cloudflare + Cloud Mail + Resend.
No server needed.
No DIY mail system maintenance.
For the average user, this combo is overkill — in a good way.
Why this setup works without servers
Cloud Mail is an open-source project running on Cloudflare Workers. The docs make it clear: it uses Cloudflare KV for storage, D1 for databases, and integrates with Resend for sending. It doesn’t replace your traditional mail server — it builds a new one on top of edge infrastructure.
Pretty clever, right?
Cloudflare Email Routing handles the incoming mail catch-all. Per the docs, when enabled, anything sent to your domain (even misspelled local parts) gets routed to a single handler — making tracking leaks even easier.
Workers function as miniature processors, D1 as a ledger, KV or R2 as storage, and Resend handles the sending. The current free plan allows for 3,000 emails per month and 100 per day, which is generally sufficient for personal use such as replying to emails, receiving verification codes, and registering services. However, do not use it for mass marketing campaigns; that is a different category, and you risk being blocked.
That's pretty much the gist of it.
You can think of it as a free mini-post office: Cloudflare provides the premises and counter space, Cloud Mail is the management system, and Resend is the external mail carrier.
Of course, free does not mean unlimited. The free plan for Cloudflare Workers has a limit on the number of daily requests, and the free tier for KV has limits on storage and write operations. As mentioned in your script, KV defaults to 1GB and 1,000 writes per day, which is generous for plain text emails; however, if you are frequently receiving large attachments, you will eventually need to upgrade to R2 or a paid plan.
The biggest risk with the free plan isn't the limits themselves.
It's that you don't know what the limits are.
Deployment Steps: Focus on These 5 Actions
Writing a tutorial for the full deployment would be lengthy: Forking the repository, setting up the Worker, configuring environment variables, creating D1 and KV, binding routes, initializing, registering the admin, connecting to Resend, and setting up webhooks...
This might seem like a bowl of noodles with 17 different toppings.
However, the main storyline consists of only 5 actions.
First step, prepare the domain name. You can purchase the domain name from any provider, but the key is to manage the DNS through Cloudflare. Even cheap, obscure top-level domains (TLDs) will work for testing purposes; there's no need to splurge on an expensive domain name just yet.
Second step, deploy the Cloud Mail as a Worker. Fork the Cloud Mail project on GitHub, then import it from your GitHub account into Cloudflare Workers & Pages. Your material notes that the path should be filled in as "mail-worker"; this is a critical detail that is easy to overlook. Missing this will cause issues.
Third step, fill in 3 environment variables. DOMAIN should be an array of your domain names, such as ["example.com"]. The admin variable should be the administrator's email, such as admin@example.com. The JWT_SECRET should be a strong, random initialization key; avoid using "testtesttest" as a permanent password, as it is too weak for production use.
This step is analogous to installing a nameplate and a lock on your house. If the nameplate is wrong, the mail cannot be delivered; if the lock is weak, anyone can break in.
Fourth step, create D1 and KV, and bind them to the Worker. Do not change the variable names. The KV binding is typically named "kv", and the D1 binding is typically named "db". Many beginners fail to deploy the project not because the code is wrong, but because they mismatched these minor details like case sensitivity, paths, or variable names.
Fifth step, set up the Email Routing catch-all. Enable Cloudflare Email Routing and direct all emails sent to this domain to your Cloud Mail Worker. This allows you to capture emails sent to any address at your domain, such as abc@yourdomain.com or shop@yourdomain.com.
Next, visit your site with the following URL structure:
Seeing the word "success" indicates that the database has been initialized.
Remove the tailing parameters from the URL to access the admin dashboard. Use the admin email you defined to register an account. Once you reach this point, you should be able to receive emails.
Being able to receive means you haven't necessarily set up sending yet; Resend is the most frequently missed component.
Many people stop here with a false sense of accomplishment: "The backend is open, and I received a test email, so I'm done."
This is incorrect.
Receiving mail and sending mail are two distinct processes.
Cloudflare Email Routing primarily handles the routing of incoming mail. To reply to someone from your address (e.g., admin@yourdomain.com), you need an outbound email service. In this setup, Resend is commonly used for this purpose.
The logic for Resend is straightforward: 1. Create a Resend account. 2. Add your domain to Resend. 3. Complete the DNS verification required by Resend. 4. Generate an API key. 5. Enter this "Resend Token" into the Cloud Mail backend settings. 6. Set up webhooks to track the status of sent emails (delivery, bounces, failures) and relay this information back to your dashboard.
There are two critical details here: First, the API Key is displayed only once during creation. Save it immediately; if you close the window without saving it, you will have to create a new key. Second, ensure that the webhooks are correctly configured. Without them, your backend dashboard will lack critical information regarding email delivery success or failure.
There are two key details here — pay attention.
First, the API key is displayed only once. You must save it immediately after generation; if you close the window without saving, it's lost forever and you'll have to recreate the account.
Second, don't check unnecessary Webhook events. Bounce, complaint, delivery, delay, and failure are enough. There's no need to track opened and clicked events for personal daily emails — it feels creepy to secretly monitor whether your friend opened your email.
This isn't about being picky in technology.
It's about setting boundaries.
We set up domain-based email to protect our privacy, not to accidentally create another privacy issue. Don't misuse the tools.
What's truly worthwhile isn't taking advantage of loopholes, but leaving a backup plan for yourself.
Many tutorials describe domain-based email as "unlimited alt accounts" or "registration benefit wonders." While that attracts clicks, it can easily mislead people.
You can use different email prefixes for different services, but if the core goal becomes exploiting platform rules, the tool becomes tainted. The best use of a good tool isn't to gain an unfair edge, but to reduce exposure.
Keep your primary email cleaner. Reduce contamination from temporary accounts. Make your personal brand look more reliable. If a platform account ever has issues, you can maintain your identity continuity through your domain email.
That's its real value.
I increasingly believe that ordinary people should own three digital assets: a personal domain, a clean primary email, and a place to store content long-term. These are understated but highly useful.
They're like a spare house key.
Usually, you don't think about it — but when things go wrong, you'll be grateful you had it all along.
References
1. Cloud Mail GitHub Project: https://github.com/maillab/cloud-mail2. Cloudflare Email Routing Docs: https://developers.cloudflare.com/email-service/configuration/email-routing-addresses/3. Cloudflare Workers Limits: https://developers.cloudflare.com/workers/platform/limits/4. Cloudflare Workers KV Free Tier: https://blog.cloudflare.com/workers-kv-free-tier/5. Resend Pricing: https://resend.com/pricing6. Cloudflare Workers + Resend Email Tutorial: https://developers.cloudflare.com/workers/tutorials/send-emails-with-resend/





