mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-07-12 16:02:10 +08:00
docs: clarify wildcard MX requirement for random subdomain (#1036)
Random subdomain mailbox creation only generates addresses; mail delivery depends on DNS / Cloudflare Email Routing covering *.<base-domain>. Cloudflare Email Routing does not inherit apex configuration onto subdomains, so a wildcard `*` MX record on the base domain is required for random subdomains to actually receive mail. - Add `[!IMPORTANT]` block in subdomain.md (zh/en) explaining the two deliverable paths: DNS-only wildcard MX (recommended for random subdomains) vs Cloudflare dashboard "Add subdomain" - Link to Cloudflare Email Routing — Subdomains official docs from worker-vars.md and subdomain.md - Instruct copying apex MX records to host `*` preserving each record's priority/target, instead of hardcoding specific MX targets - Shorten frontend `randomSubdomainTip` for CreateAccount and Login views (6 locales: zh/en/de/es/ja/pt-BR), drop Markdown backticks (Vue text interpolation renders them literally), and point users to the docs instead of embedding DNS instructions - Trim overlap between existing `[!NOTE]` and new `[!IMPORTANT]` in subdomain.md - Update CHANGELOG.md / CHANGELOG_EN.md under v1.9.0(main) Closes #1035 Closes #1026 Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -52,9 +52,30 @@ If you want to create an address under a specific subdomain such as `team.abc.co
|
||||
>
|
||||
> There is currently no backend switch that globally forces random subdomains; API calls that do
|
||||
> not pass `enableRandomSubdomain: true` will not randomize automatically.
|
||||
|
||||
> [!IMPORTANT] A wildcard MX DNS record is required for random subdomains
|
||||
> The worker only generates addresses like `name@<random>.abc.com` — **whether mail actually
|
||||
> arrives depends entirely on DNS / Email Routing being configured for `*.abc.com`**, and
|
||||
> Cloudflare Email Routing does **not** propagate the base-domain configuration onto subdomains.
|
||||
> See Cloudflare's [Email Routing — Subdomains](https://developers.cloudflare.com/email-routing/setup/subdomains/)
|
||||
> documentation.
|
||||
>
|
||||
> It does not automatically create Cloudflare-side subdomain mail routes or DNS records for you,
|
||||
> so make sure the base-domain/subdomain routing is already available first.
|
||||
> There are two ways to make `*.abc.com` deliverable:
|
||||
>
|
||||
> 1. **DNS-only wildcard MX (simplest workaround)** — In your DNS, copy **every existing MX
|
||||
> record on `abc.com`** to host `*`, preserving each record's **priority and target value**.
|
||||
> This makes `*.abc.com` resolve to the same MX targets as the apex, so mail flows into the
|
||||
> same Cloudflare Email Routing zone and is picked up by the apex Catch-all rule that points
|
||||
> at the Worker. No extra Cloudflare-side action is needed.
|
||||
> 2. **Cloudflare dashboard "Add subdomain"** — Add the specific subdomain in the Email Routing
|
||||
> dashboard and configure its DNS + Catch-all routing rule separately. This only covers the
|
||||
> specific subdomain you add, so it is not suitable for arbitrary random subdomains.
|
||||
>
|
||||
> For random subdomain mailboxes, option **(1)** is the recommended path. Without it, the
|
||||
> random subdomain feature will appear to work in the UI but inbound mail will never reach the
|
||||
> Worker.
|
||||
>
|
||||
> Reference issue: [#1035](https://github.com/dreamhunter2333/cloudflare_temp_email/issues/1035)
|
||||
|
||||
## Let APIs Specify Subdomains Directly
|
||||
|
||||
|
||||
@@ -51,6 +51,15 @@
|
||||
> `RANDOM_SUBDOMAIN_DOMAINS` only controls automatic random subdomain generation during mailbox
|
||||
> creation. It does not create Cloudflare-side subdomain routing for you.
|
||||
>
|
||||
> To actually receive mail on addresses like `name@<random>.abc.com`, **you must add a wildcard
|
||||
> `*` MX record under the base domain in DNS** by copying the apex's existing MX records to
|
||||
> host `*` (preserving each record's priority and target). Cloudflare Email Routing does not
|
||||
> inherit the apex configuration onto subdomains — see the
|
||||
> [Cloudflare Email Routing — Subdomains](https://developers.cloudflare.com/email-routing/setup/subdomains/)
|
||||
> docs,
|
||||
> [#1035](https://github.com/dreamhunter2333/cloudflare_temp_email/issues/1035) and
|
||||
> [Configure Subdomain Email](/en/guide/feature/subdomain).
|
||||
>
|
||||
> Subdomain addresses are usually best used for receiving only; for sending, prefer the main
|
||||
> domain.
|
||||
>
|
||||
|
||||
@@ -45,8 +45,18 @@ RANDOM_SUBDOMAIN_LENGTH = 8
|
||||
> 这个功能只是在“创建地址”时自动补一个随机二级域名。
|
||||
>
|
||||
> 当前没有“全局强制随机二级域名”的后端开关;未传 `enableRandomSubdomain: true` 的 API 调用不会自动随机。
|
||||
|
||||
> [!IMPORTANT] 随机子域名需要 DNS 通配 MX 记录
|
||||
> 程序只负责生成 `name@<random>.abc.com` 这样的地址,**能不能收到邮件完全取决于 DNS / Email Routing 是否覆盖到 `*.abc.com`**;Cloudflare Email Routing 的子域名配置**不会**从基础域名继承。可参考 Cloudflare 的 [Email Routing — Subdomains](https://developers.cloudflare.com/email-routing/setup/subdomains/) 文档。
|
||||
>
|
||||
> 它不会自动帮你创建 Cloudflare 侧的子域名收件路由或 DNS 配置,请先确保基础域名/子域名路由本身已经可用。
|
||||
> 让 `*.abc.com` 可投递有两种做法:
|
||||
>
|
||||
> 1. **DNS 通配 MX 记录(最简方案)** — 在 `abc.com` 的 DNS 中,把基础域名上**现有的每一条 MX 记录**都复制一份到 `*` 主机名上,**保留每条记录的 priority 与 target**。这样 `*.abc.com` 会解析到与 apex 相同的 MX 目标,邮件流向同一个 Cloudflare Email Routing zone,并由 apex 的 Catch-all 规则交给 Worker,**Cloudflare 侧不需要额外配置**。
|
||||
> 2. **Cloudflare 控制台 “Add subdomain”** — 在 Email Routing 后台显式添加该子域名,并单独配置其 DNS 与 Catch-all 路由规则。这只覆盖你添加的那个具体子域名,不适合随机生成的任意子域名。
|
||||
>
|
||||
> 随机子域名场景下推荐使用 **方案 (1)**。如果不做这一步,随机子域名功能在前端看起来正常,但实际邮件不会进入 Worker。
|
||||
>
|
||||
> 参考 issue:[#1035](https://github.com/dreamhunter2333/cloudflare_temp_email/issues/1035)
|
||||
|
||||
## 允许 API 直接指定子域名
|
||||
|
||||
|
||||
@@ -51,6 +51,13 @@
|
||||
> `RANDOM_SUBDOMAIN_DOMAINS` 只负责“创建地址时自动补随机子域名”,不会自动帮你创建 Cloudflare
|
||||
> 侧的子域名路由。
|
||||
>
|
||||
> 要让 `name@<随机>.abc.com` 这种随机子域名地址真的能收到邮件,**必须在基础域名的 DNS 中为
|
||||
> `*` 子域添加通配 MX 记录**:把基础域名上现有的每一条 MX 记录都复制到 `*` 主机名上,
|
||||
> 并保留 priority 与 target;Email Routing 子域不继承父域配置,详见 Cloudflare 的
|
||||
> [Email Routing — Subdomains](https://developers.cloudflare.com/email-routing/setup/subdomains/)
|
||||
> 文档、[#1035](https://github.com/dreamhunter2333/cloudflare_temp_email/issues/1035) 与
|
||||
> [配置子域名邮箱](/zh/guide/feature/subdomain)。
|
||||
>
|
||||
> 子域名地址通常更适合收件;如果要发件,仍建议优先使用主域名。
|
||||
>
|
||||
> `ENABLE_CREATE_ADDRESS_SUBDOMAIN_MATCH` 与随机子域名功能不同:它允许 API 调用方**直接指定**
|
||||
|
||||
Reference in New Issue
Block a user