Files
duckmail_gui/README.md
2026-03-21 09:25:24 +08:00

110 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Temp Mail GUI (PySide6)
一个基于 PySide6 的临时邮箱创建与收信工具。
当前版本已经适配 `cloudflare_temp_email` 后端,推荐配置:
- API Base: `https://temp-email-api.example.com`
- Domain: `example.com`
- Backend Type: `cloudflare_temp_email`
- Bearer: 填 `cloudflare_temp_email` 的管理员密码
当前版本改为纯 PostgreSQL 账号源:
- 账号列表直接从 PostgreSQL `registered_accounts` 读取
- 创建邮箱后直接写入 PostgreSQL
- 导入账号并获取 Token 后直接写入 PostgreSQL
- 界面采用分页布局,日常使用时只看账号页即可
现在也支持:
- PostgreSQL / MySQL 二选一
- 设置页显示或隐藏密码
- 数据库连接测试
- 一键初始化数据库和表
- 勾选后在数据库或表不存在时自动创建
- 通过脚本把 PostgreSQL 里的某个域名邮箱补档到 D1
## 补档脚本
把 PostgreSQL 中某个域名的邮箱导出成 Cloudflare D1 可执行的 SQL
```bash
python sync_pg_to_d1.py \
--pg-host 127.0.0.1 \
--pg-port 5432 \
--pg-db mail_accounts_db \
--pg-user postgres \
--pg-password 'your-password' \
--table registered_accounts \
--domain example.com \
--output /tmp/kotei_asia_import.sql
```
## 安装依赖
```bash
pip install -r requirements.txt
```
## 启动
```bash
python gui.py
```
## 页面说明
### 账号页
- 搜索账号
- 查看账号列表
- 查看账号详情
- 获取邮件
- 查看邮件正文
- 查看日志
### 设置页
- DuckMail API 配置
- PostgreSQL 连接配置
- 自动刷新配置
- 导入账号并写入数据库
- 创建邮箱并写入数据库
## 数据表结构
默认读取并写入表:`registered_accounts`
默认字段:
- `email`
- `mail_password`
- `mail_token`
- `chatgpt_password`
- `name`
- `birthdate`
- `created_at`
其中 `email` 需要能作为唯一键或主键,以支持 `on conflict (email) do update`
## 配置说明
程序会将界面配置保存到 `config_gui.json`,包括:
- Cloudflare Temp Mail API Base
- Domain
- Admin Password
- Proxy
- 自动刷新开关与间隔
- PostgreSQL Host / Port / DB / User / Password
## requirements
当前依赖:
- `PySide6`
- `requests`
- `psycopg[binary]`
- `PyMySQL`