From db93828a8178625fe00f8404422776c504cd0c3f Mon Sep 17 00:00:00 2001 From: tsymr Date: Thu, 2 Apr 2026 23:13:10 +0800 Subject: [PATCH] feat(subdomain): add random second-level mailbox support (#924) Summary: add random second-level subdomain mailbox creation for web, admin, and Telegram. Scope: worker config, UI toggle, and README/VitePress documentation. Co-authored-by: wufei --- README.md | 1 + README_EN.md | 1 + frontend/src/api/index.js | 1 + frontend/src/store/index.js | 2 + frontend/src/views/admin/CreateAccount.vue | 29 +++- frontend/src/views/common/Login.vue | 34 +++- frontend/src/views/index/TelegramAddress.vue | 8 +- .../docs/en/guide/feature/subdomain.md | 26 ++++ vitepress-docs/docs/en/guide/worker-vars.md | 9 ++ .../docs/zh/guide/feature/subdomain.md | 24 +++ vitepress-docs/docs/zh/guide/worker-vars.md | 8 + worker/src/admin_api/index.ts | 3 +- worker/src/admin_api/worker_config.ts | 2 + worker/src/commom_api.ts | 1 + worker/src/common.ts | 145 ++++++++++++------ worker/src/i18n/en.ts | 1 + worker/src/i18n/type.ts | 1 + worker/src/i18n/zh.ts | 1 + worker/src/mails_api/index.ts | 3 +- worker/src/telegram_api/common.ts | 4 +- worker/src/telegram_api/miniapp.ts | 12 +- worker/src/types.d.ts | 2 + worker/src/utils.ts | 8 + worker/wrangler.toml.template | 4 + 24 files changed, 273 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index fe0bd446..70f1aaea 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ - [x] 使用 `rust wasm` 解析邮件,解析速度快,几乎所有邮件都能解析,node 的解析模块解析邮件失败的邮件,rust wasm 也能解析成功 - [x] **AI 邮件识别** - 使用 Cloudflare Workers AI 自动提取邮件中的验证码、认证链接、服务链接等重要信息 +- [x] 支持为指定基础域名创建随机二级域名邮箱地址,更适合收件隔离场景 - [x] 支持发送邮件,支持 `DKIM` 验证 - [x] 支持 `SMTP` 和 `Resend` 等多种发送方式 - [x] 增加查看 `附件` 功能,支持附件图片显示 diff --git a/README_EN.md b/README_EN.md index 3b33404a..7ecf9065 100644 --- a/README_EN.md +++ b/README_EN.md @@ -109,6 +109,7 @@ Try it now → [https://mail.awsl.uk/](https://mail.awsl.uk/) - [x] Use `rust wasm` to parse emails, with fast parsing speed. Almost all emails can be parsed. Even emails that Node.js parsing modules fail to parse can be successfully parsed by rust wasm - [x] **AI Email Recognition** - Use Cloudflare Workers AI to automatically extract verification codes, authentication links, service links and other important information from emails +- [x] Support optional random second-level subdomain mailbox creation for selected base domains - [x] Support sending emails with `DKIM` verification - [x] Support multiple sending methods such as `SMTP` and `Resend` - [x] Add attachment viewing feature with support for displaying attachment images diff --git a/frontend/src/api/index.js b/frontend/src/api/index.js index 8554237a..0dcec6c7 100644 --- a/frontend/src/api/index.js +++ b/frontend/src/api/index.js @@ -74,6 +74,7 @@ const getOpenSettings = async (message, notification) => { maxAddressLen: res["maxAddressLen"] || 30, needAuth: res["needAuth"] || false, defaultDomains: res["defaultDomains"] || [], + randomSubdomainDomains: res["randomSubdomainDomains"] || [], domains: res["domains"].map((domain, index) => { return { label: domainLabels.length > index ? domainLabels[index] : domain, diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 0a57deff..996348c4 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -28,6 +28,8 @@ export const useGlobalState = createGlobalState( enableIndexAbout: false, /** @type {string[]} */ defaultDomains: [], + /** @type {string[]} */ + randomSubdomainDomains: [], /** @type {Array<{label: string, value: string}>} */ domains: [], copyright: 'Dream Hunter', diff --git a/frontend/src/views/admin/CreateAccount.vue b/frontend/src/views/admin/CreateAccount.vue index 87167f68..1ce38d76 100644 --- a/frontend/src/views/admin/CreateAccount.vue +++ b/frontend/src/views/admin/CreateAccount.vue @@ -1,5 +1,5 @@