diff --git a/src/email_client.py b/src/email_client.py index cf388da..7f347ad 100644 --- a/src/email_client.py +++ b/src/email_client.py @@ -163,6 +163,9 @@ def fetch_unseen_emails(account: EmailAccount) -> list[Email]: emails.append(Email(uid=uid, subject=subject, sender=sender, recipient=recipient, body=body, date=date_str, reply_to=reply_to, account_email=account.username, folder=folder)) + + # FETCH 可能被服务器自动标已读,立即标回未读 + conn.uid("STORE", uid, "-FLAGS", "\\Seen") except Exception as e: logger.error(" UID %s FETCH 失败,跳过: %s", uid, e) continue