docs: update missing documentation from closed issues (#948)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dream Hunter
2026-04-06 11:11:44 +08:00
committed by GitHub
parent a0db913952
commit b86d1faac4
16 changed files with 120 additions and 20 deletions

View File

@@ -10,6 +10,19 @@
![admin](/feature/admin.png)
## 账号列表排序
管理后台的账号标签页支持按列排序,可点击表头对以下列进行升序/降序排列:
- ID
- 名称
- 创建时间
- 更新时间
- 邮件数量
- 发送数量
搜索邮箱地址时,分页会自动重置到第 1 页。
## 如果你的网站只可私人访问,可通过此禁用检查
`DISABLE_ADMIN_PASSWORD_CHECK = true`

View File

@@ -35,7 +35,7 @@ res = requests.post(
}
)
# 返回值 {"jwt": "<Jwt>"}
# 返回值 {"jwt": "<Jwt>", "address": "<邮箱地址>", "address_id": 123}
print(res.json())
```

View File

@@ -2,7 +2,19 @@
## 通过 HTTP API 发送邮件
这是一个 `python` 的例子,使用 `requests` 库发送邮件。
有两种 HTTP API 端点可以发送邮件,区别如下:
| 端点 | 认证方式 | 适用场景 |
|------|---------|---------|
| `/api/send_mail` | `Authorization: Bearer <地址JWT>` header | 内部调用,需要先通过 cookie / header 鉴权 |
| `/external/api/send_mail` | 请求体中的 `token` 字段 | 外部系统集成,无需 header 鉴权 |
::: tip 什么是"地址 JWT"
地址 JWT 是通过 `/api/new_address``/admin/new_address` 创建邮箱地址时返回的 `jwt` 字段。
你可以在前端 UI 的「密码」菜单中查看它。它**不是** `JWT_SECRET` 环境变量,也**不是** admin 密码。
:::
### 方式一:通过 Header 认证(`/api/send_mail`
```python
send_body = {
@@ -15,17 +27,22 @@ send_body = {
}
res = requests.post(
"http://localhost:8787/api/send_mail",
"https://你的worker域名/api/send_mail",
json=send_body, headers={
"Authorization": f"Bearer {你的JWT密码}",
"Authorization": f"Bearer {地址JWT}",
# "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码
"Content-Type": "application/json"
}
)
```
# 使用 body 验证
### 方式二:通过 Body Token 认证(`/external/api/send_mail`
适合外部系统调用,将地址 JWT 放在请求体的 `token` 字段中:
```python
send_body = {
"token": "<你的JWT密码>",
"token": "<地址JWT>",
"from_name": "发件人名字",
"to_name": "收件人名字",
"to_mail": "收件人地址",
@@ -34,7 +51,7 @@ send_body = {
"content": "<邮件内容html 或者 文本>",
}
res = requests.post(
"http://localhost:8787/external/api/send_mail",
"https://你的worker域名/external/api/send_mail",
json=send_body, headers={
# "x-custom-auth": "<你的网站密码>", # 如果启用了私有站点密码
"Content-Type": "application/json"