fix: restore -FLAGS Seen after FETCH, protected by _processing_uids
This commit is contained in:
@@ -163,6 +163,9 @@ def fetch_unseen_emails(account: EmailAccount) -> list[Email]:
|
|||||||
emails.append(Email(uid=uid, subject=subject, sender=sender, recipient=recipient,
|
emails.append(Email(uid=uid, subject=subject, sender=sender, recipient=recipient,
|
||||||
body=body, date=date_str, reply_to=reply_to, account_email=account.username,
|
body=body, date=date_str, reply_to=reply_to, account_email=account.username,
|
||||||
folder=folder))
|
folder=folder))
|
||||||
|
|
||||||
|
# FETCH 可能被服务器自动标已读,立即标回未读
|
||||||
|
conn.uid("STORE", uid, "-FLAGS", "\\Seen")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(" UID %s FETCH 失败,跳过: %s", uid, e)
|
logger.error(" UID %s FETCH 失败,跳过: %s", uid, e)
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user