Repository navigation
这是一个安全加固版本:根据安全扫描和多轮审查修复了草稿审批、登录会话、邮件传输和同步中的一批问题,并开始回收不再使用的邮件原件,建议尽快升级。
升级须知
- 未开启 SSL 的 SMTP / IMAP 连接现在必须走 STARTTLS,只有 127.0.0.1、::1 这类回环 IP 允许明文;写成 localhost 或经过代理的连接也会要求加密
- 退出登录会让这个用户在所有设备上的会话失效
- AI 渠道没设并发限制时默认最多同时 10 个请求,排队超过 200 个时接口返回 503 和 Retry-After
安全
- 审批绑定你看到的草稿版本:审批期间智能体改了内容、收件人(包括折叠起来的抄送、密送)或附件,审批会失败,不会把没看过的内容发出去
- 转发草稿和附件一起创建,不会出现先审批空草稿、附件后补上的情况
- 退出登录会吊销所有会话,复制走的 Cookie 也会失效;修改密码时并发登录拿不到新会话
- 登录限流按可信客户端 IP 和账号计数,并发猜密码不能绕过;首次初始化不会并发创建出两个管理员
- 各接口在读请求体之前就限制大小:附件按附件上限,草稿、签名和 MCP 16MB,其余 2MB
- OAuth 授权的每小时发信额度检查和排队在同一个事务里,不能并发超发
- 特制邮件里大量 cid: 引用不会再卡住阅读页
修复
- 同步时临时的数据库或磁盘错误不再跳过邮件,整批重试;只有确定重试也会失败的数据错误才跳过单封邮件
- 去掉邮件里的 NUL 字符再入库,单封坏邮件不会中断整批同步
- 删除邮件、文件夹或邮箱后,不再引用的原始邮件文件每天自动清理,磁盘占用不再只增不减
- Graph 邮件下载改成流式读取,到大小上限就停,不会先把整封邮件读进内存
- 邮箱一直同步失败时,account.error 通知每次出错只推一次,同一个邮箱一小时内最多一次
- AI 队列满时后台分析稍后重试,不再直接跳过;助手对话会显示错误,不再保存空回复
This is a security hardening release. A static scan and several review rounds turned up issues in draft approval, login sessions, mail transport and sync, all fixed here. Unreferenced raw message files are now reclaimed too. Upgrading soon is recommended.
Before you upgrade
- SMTP and IMAP connections without SSL now require STARTTLS. Plaintext is allowed only for loopback IPs such as 127.0.0.1 and ::1; localhost and proxied connections must use encryption
- Signing out ends the user's sessions on every device
- AI channels without a concurrency limit now allow 10 requests at a time, and return 503 with Retry-After once 200 are queued
Security
- Approval is bound to the draft version you reviewed. If an agent changes the content, recipients (including collapsed Cc and Bcc) or attachments meanwhile, the approval fails instead of sending something you didn't see
- Forward drafts are created together with their attachments, so an empty draft can no longer be approved before the attachments land
- Signing out revokes every session, including copied cookies; a login racing a password change no longer gets a session
- Login throttling counts by trusted client IP and by account, and parallel guesses can't slip past it; first-run setup can't create two administrators at once
- Request bodies are size-limited before they're read: attachments use the attachment cap, drafts, signatures and MCP 16 MB, everything else 2 MB
- The hourly send quota for OAuth clients is checked and the draft queued in one transaction, so parallel requests can't exceed it
- Crafted messages with many cid: references no longer freeze the reader
Fixes
- Transient database or disk errors during sync no longer skip messages; the batch is retried, and only data errors that would fail again skip a single message
- NUL characters are stripped before storing mail, and one bad message no longer aborts a sync batch
- Raw message files left unreferenced after deleting mail, folders or mailboxes are cleaned up daily, so disk usage no longer only grows
- Graph downloads are streamed and stop at the size limit instead of loading the whole message into memory
- A mailbox that keeps failing to sync sends one account.error notification per failure, at most once an hour
- When the AI queue is full, background analysis retries later instead of being skipped, and the assistant shows an error instead of saving an empty reply
Docker
docker pull ghcr.io/gopkg-dev/damail:v0.2.2