d70b817fd4
feat: AI并行处理 + 修复邮件丢失
...
- _ai_processor 改用 ThreadPoolExecutor(5 workers) 并行调用AI
- _tg_worker 每轮排空所有待发TG消息(原来每轮只取1条)
- fetch_unseen_emails 单封FETCH失败不再丢弃整个批次,跳过继续
2026-07-06 20:12:24 +08:00
0c1ccdfc79
fix: 修复 _email_poller 线程静默死亡问题
...
- IMAP 连接加 30s socket timeout,防止 _send_id_command 等操作永久阻塞
- _email_poller 加顶层 try/except,异常后 sleep 5s 继续循环
- @retry() 加指数退避延迟(1s,2s,4s...),避免重试风暴
2026-07-06 19:54:23 +08:00
c684090b9c
feat: handle Reply-To header, add account_email field, decode address headers
2026-07-02 22:37:15 +08:00
d7daddf491
feat: IMAP 支持 SSL/STARTTLS 配置
2026-07-02 22:18:51 +08:00
ad950ff367
feat: 收件人/发件人改用邮件原始头数据
...
- sender 从 decode 改为使用原始 From 头
- 新增 recipient 字段,使用原始 To 头
- 移除 ai_process 中对 acct.username 的依赖
2026-07-02 22:04:27 +08:00
d334b6f3eb
feat: enhance logging detail across all modules
...
- email_client: log IMAP connection, login, UNSEEN count, each email
details (subject/sender/body size), mark-as-seen progress
- ai_client: log AI request params, timing, token usage, response size
- smtp_client: log SMTP connect, login, send details
- tg_bot: log all callback actions with subject context, message states
- main: periodic queue depth report (email_queue/tg_queue/pending_uids)
2026-07-02 21:00:40 +08:00
a6817d3e11
feat: add retry(10) on all network requests
...
- New src/retry.py with configurable retry decorator
- Applied @retry() to fetch_unseen_emails, mark_as_seen,
summarize_email, and send_message
- No backoff delay between retries
2026-07-02 20:02:03 +08:00
89149b506c
fix: add IMAP ID command for 126.com/163.com support
...
These providers require a client identification (ID command, RFC 2971)
before SELECT INBOX, otherwise they reject with 'SELECT Unsafe Login'.
Extract shared login+select logic into _login_and_prepare helper.
2026-07-02 19:56:14 +08:00
82403de6df
fix: check IMAP select() return status before issuing commands
...
- Add _select_mailbox helper that raises on non-OK status
- Prevents 'command SEARCH illegal in state AUTH' by catching
failed mailbox selection early with a clear error message
2026-07-02 19:53:26 +08:00
e2826a3e3b
feat: init AI email summarization bot
...
- Multi-account IMAP email polling with UID tracking
- DeepSeek API integration with JSON Mode structured output
- Telegram notification with formatted MarkdownV2 message
- YAML config with dataclass-based type validation
- Graceful shutdown on SIGINT/SIGTERM
- 60s default polling interval
2026-07-02 19:45:34 +08:00