docs: restructure sidebar, expand FAQ, enhance send mail docs (#949)

* docs: restructure sidebar, expand FAQ, enhance send mail docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: remove specific example domain reference in FAQ per review

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dream Hunter
2026-04-06 11:47:25 +08:00
committed by GitHub
co-authored by Claude Opus 4.6
parent b86d1faac4
commit 5248c03b6c
8 changed files with 201 additions and 35 deletions
+20 -5
View File
@@ -1,4 +1,4 @@
# 常见问题
# 常见问题 (FAQ)
> [!NOTE] 注意
> 如果你的问题没有在这里找到解决方案,请到 `Github Issues` 中搜索或者提问, 或者到 Telegram 群组中提问。
@@ -10,7 +10,7 @@
| 使用 Cloudflare Workers 给已认证的转发邮箱发送邮件 | 使用 cf 的 API 进行发送,只支持绑定到 CF 上的收件地址,即 CF EMAIL 转发目的地址 |
| 绑定多个域名 | 每个域名都需要设置 email 转发到 worker |
## worker 相关
## Worker 相关
| 问题 | 解决方案 |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------- |
@@ -19,15 +19,30 @@
| `二级域名无法发送邮件` | [参考](https://github.com/dreamhunter2333/cloudflare_temp_email/issues/515) |
| `Failed to send verify code: No balance` | admin 后台设置无限制邮件或者发件权限页面增加额度 |
| `Github OAuth无法获取到邮箱 400 Failed to get user email` | 需要 github 用户设置公开邮箱 |
| `Cannot read properties of undefined (reading 'map')` | worker 变量没有设置成功 |
| `Cannot read properties of undefined (reading 'map')` | worker 变量没有设置成功,请检查 `DOMAINS``ADMIN_PASSWORDS` 等 JSON 格式变量是否正确配置 |
## pages 相关
## Pages 相关
| 问题 | 解决方案 |
| --------------- | ---------------------------------------- |
| `network error` | 使用无痕模式或者清空浏览器缓存,DNS 缓存 |
| 刷新页面或直接访问 `/admin``/user` 返回 404 | 本项目是单页应用(SPA),通过 UI 部署 Pages 时需要在高级选项中将「未找到处理」设置为 `Single-page application (SPA)`。详见 [Pages 前端部署](/zh/guide/ui/pages) |
## telegram bot
## 发送邮件相关
| 问题 | 解决方案 |
| --------------- | ---------------------------------------- |
| 设置了 `DEFAULT_SEND_BALANCE` 但仍提示 `No balance` | `DEFAULT_SEND_BALANCE` 是用户**申请发信权限时**的默认额度,用户需要先在前端界面点击「申请发信权限」才会生效。也可以在 admin 后台将地址加入「无限制发送地址列表」,或配置 `NO_LIMIT_SEND_ROLE` |
| 提示 `请先为此域名启用 resend 或 smtp` | 需要先配置 `RESEND_TOKEN``SMTP_CONFIG`,详见 [配置发送邮件](/zh/guide/config-send-mail) |
| `SMTP_CONFIG` 配置了但发送失败 | 请确认 JSON 中的 key 是**你自己的发信域名**(如 `your-domain.com`),不要直接复制示例 key。详见 [配置发送邮件](/zh/guide/config-send-mail#使用-smtp-发送邮件) |
## 邮件客户端相关
| 问题 | 解决方案 |
| --------------- | ---------------------------------------- |
| 设置了 `ENABLE_ADDRESS_PASSWORD` 但 Foxmail/Outlook 等客户端无法登录 | `ENABLE_ADDRESS_PASSWORD` 只是开启「地址密码登录」Web 接口,**不等于**提供标准 IMAP/SMTP 服务。要使用邮件客户端收发邮件,需要额外部署 [SMTP/IMAP 代理服务](/zh/guide/feature/config-smtp-proxy) |
## Telegram Bot
| 问题 | 解决方案 |
| -------------------------------------------------------------- | -------------------------------------------------- |
@@ -35,12 +35,18 @@ wrangler secret put RESEND_TOKEN_DREAMHUNTER2333_XYZ
## 使用 SMTP 发送邮件
`SMTP_CONFIG` 的格式如下,key 为域名value 为 SMTP 配置SMTP 配置格式详情可以参考 [zou-yu/worker-mailer](https://github.com/zou-yu/worker-mailer/blob/main/README_zh-CN.md)
`SMTP_CONFIG` 的格式如下,**key 必须是你自己的发信域名**value 为 SMTP 配置
SMTP 配置格式详情可以参考 [zou-yu/worker-mailer](https://github.com/zou-yu/worker-mailer/blob/main/README_zh-CN.md)
> [!warning] 重要
> JSON 中的 key(如下面示例中的 `your-domain.com`)必须替换为**你自己的域名**,即 `DOMAINS` 变量中配置的域名。
> 这是最常见的配置错误之一,请勿直接复制示例中的域名。
```json
{
"awsl.uk": {
"host": "smtp.xxx.com",
"your-domain.com": {
"host": "smtp.example.com",
"port": 465,
"secure": true,
"authType": [
@@ -48,13 +54,46 @@ wrangler secret put RESEND_TOKEN_DREAMHUNTER2333_XYZ
"login"
],
"credentials": {
"username": "username",
"password": "password"
"username": "your-smtp-username",
"password": "your-smtp-password"
}
}
}
```
**字段说明:**
| 字段 | 说明 |
|------|------|
| key(如 `your-domain.com` | 你的发信域名,必须与 `DOMAINS` 中配置的域名一致 |
| `host` | SMTP 服务器地址,如 `smtp.mailgun.org``smtp.gmail.com` 或你自建的 SMTP 服务器地址 |
| `port` | SMTP 端口,通常 `465`SSL)或 `587`STARTTLS |
| `secure` | 是否使用 SSL/TLS,端口 465 时设为 `true`,端口 587 时设为 `false` |
| `authType` | 认证方式,一般使用 `["plain", "login"]` |
| `credentials.username` | SMTP 服务器的登录用户名 |
| `credentials.password` | SMTP 服务器的登录密码 |
如果你有**多个域名**使用不同的 SMTP 服务,在同一个 JSON 中添加多个 key 即可:
```json
{
"domain-a.com": {
"host": "smtp.mailgun.org",
"port": 465,
"secure": true,
"authType": ["plain", "login"],
"credentials": { "username": "user@domain-a.com", "password": "xxx" }
},
"domain-b.com": {
"host": "smtp.gmail.com",
"port": 465,
"secure": true,
"authType": ["plain", "login"],
"credentials": { "username": "user@gmail.com", "password": "app-password" }
}
}
```
然后执行下面的命令,将 `SMTP_CONFIG` 添加到 secrets 中
> [!NOTE]
@@ -68,6 +107,19 @@ cd worker
wrangler secret put SMTP_CONFIG
```
## 发信余额机制
用户发送邮件需要有发信余额。余额机制如下:
1. **申请发信权限**:用户需要先在前端界面点击「申请发信权限」按钮
2. **默认额度**:申请时会获得 `DEFAULT_SEND_BALANCE` 环境变量设置的默认额度(如果未设置则为 0)
3. **无限制发送**:以下方式可以跳过余额检查:
- 在 admin 后台将地址加入「无限制发送地址列表」
- 配置 `NO_LIMIT_SEND_ROLE` 环境变量,指定可以无限发送的用户角色
> [!NOTE]
> `DEFAULT_SEND_BALANCE` **不会**自动给所有地址充值余额,用户必须先主动申请发信权限,额度才会生效。
## 给 Cloudflare 上已认证的转发邮箱发送邮件
仅支持 CLI 部署时使用,在 `wrangler.toml` 中添加 `send_email` 配置