Fix emails marked as read despite mark_as_read: false
Open IMAP folder in readonly mode when mark_as_read is false, preventing FETCH RFC822 from implicitly setting the \Seen flag.
This commit is contained in:
+5
-1
@@ -441,7 +441,11 @@ async def watch_folder(
|
|||||||
client = None
|
client = None
|
||||||
try:
|
try:
|
||||||
client = await asyncio.to_thread(get_imap_client, account)
|
client = await asyncio.to_thread(get_imap_client, account)
|
||||||
await asyncio.to_thread(client.select_folder, folder)
|
await asyncio.to_thread(
|
||||||
|
client.select_folder,
|
||||||
|
folder,
|
||||||
|
readonly=not account.get("mark_as_read", False),
|
||||||
|
)
|
||||||
|
|
||||||
# Check IDLE support
|
# Check IDLE support
|
||||||
if not client.has_capability("IDLE"):
|
if not client.has_capability("IDLE"):
|
||||||
|
|||||||
Reference in New Issue
Block a user