Skip to content

feat(mail): manage and sync Cloudflare domains and addresses - #4

Merged
KnowSky404 merged 10 commits into
mainfrom
feat/mail-domain-management
Oct 9, 2026
Merged

KnowSky404 merged 10 commits into
mainfrom
feat/mail-domain-management

Conversation

@KnowSky404

@KnowSky404 KnowSky404 commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

进入域名和邮箱地址页面时,自动发现 Cloudflare 中指向本收信 Worker 的已有配置;同时支持核验并接入新域名、编辑域名策略和邮箱名称/签名。重复同步保留现有启停、删除及操作状态,不接管外部规则,也不自动启用发信。

修复 Workers 原生 fetch 的接收者绑定问题,避免真实同步请求失败;同步提示区分 Token 权限、连接、超时和限流,接口仅返回安全的错误类别。

  • Preview 共用生产 D1/R2/Owner,独立发布代码,使用默认 workers.dev 地址;原有 Preview 自定义域名已按要求移除。
  • 补齐 API、配置示例、操作与部署文档。本次没有 D1 migration,schema 保持 28;私有部署配置和 .env 未提交。
  • 本地验证:604 项 Bun 测试通过,类型检查与构建通过;邮件身份管理功能的 9 项 Chromium 验证通过,覆盖桌面、手机和窄屏。
  • Cloudflare 运行时验证:真实 Zone/规则读取及连续两次完整同步通过,重复同步新增记录为 0、警告为 0;不修改 Email Routing/catch-all/MX。Pre 的桌面/手机登录页与健康接口通过。真实收发信不属于这些检查的证明范围。
  • 合并前验证 PR 的精确 head CI;合并后验证 main 的精确 SHA CI,再按授权将 main 部署到生产。

WebKit 测试使用可见、可用控件的键盘操作,并为标签创建唯一数据以兼容串行重试;本机两个场景连续运行三轮,6 项全部通过。

界面截图使用本地合成数据;手机截图展示单个域名同步失败时保留已有配置的提示。

域名同步:桌面

邮箱管理:手机及部分同步失败提示

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T06:56:59.663807Z be2f9a0 PR opened
🔒 Security Review ✅ Completed 2026-10-09T06:59:04.032451Z be2f9a0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be2f9a0063

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

syncNotice = '';
try {
const result = await requestJson<{ sync: { domainsCreated: number; addressesCreated: number;
warnings: Array<{ domainName: string; code: string }> } }>('/api/workspace/mail-identities/sync', { method: 'POST' });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Render local identities before awaiting provider sync

When Cloudflare is slow or unavailable, this awaited sync keeps loading true and delays copying the already-successful GET response into domains and addresses; since the server-side discovery deadline is 25 seconds, opening the page or manually retrying can hide all saved configuration for that entire period. Apply the initial GET result before starting discovery and update it again after sync so provider latency does not make local identity management temporarily unavailable.

Useful? React with 👍 / 👎.

@KnowSky404
KnowSky404 merged commit 63ec8cf into main Oct 9, 2026
2 checks passed
@KnowSky404
KnowSky404 deleted the feat/mail-domain-management branch October 9, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant