fix(outlook): 多项修复与优化

- imap_new: 连接池并发安全(锁外建连、占位防重复)、IDLE tag 改用独立计数器避免私有API、get_recent_emails 新增 since_minutes 参数
- service.py: 同步更新
- accounts.py: Outlook 收件箱配置按 email 不区分大小写匹配、不受 enabled 限制
- settings.js: Outlook 批量导入前端校验要求四字段且 client_id/refresh_token 非空
This commit is contained in:
cnlimiter
2026-03-21 02:41:30 +08:00
committed by Mison
parent 344cf0088c
commit 16f76076c5
4 changed files with 169 additions and 59 deletions

View File

@@ -1028,9 +1028,11 @@ def _build_inbox_config(db, service_type, email: str) -> dict:
EmailServiceModel.enabled == True
)
if service_type == EST.OUTLOOK:
# 按 config.email 匹配账号 email
services = query.all()
svc = next((s for s in services if (s.config or {}).get("email") == email), None)
# 按 config.email 精确匹配,不受 enabled 限制(收件箱是账号自己的邮箱)
all_outlook = db.query(EmailServiceModel).filter(
EmailServiceModel.service_type == db_type
).all()
svc = next((s for s in all_outlook if (s.config or {}).get("email", "").lower() == email.lower()), None)
else:
svc = query.order_by(EmailServiceModel.priority.asc()).first()