feat: Don't mark MDNs as IMAP-seen

Marking MDNs as seen is useless, they shouldn't be displayed by any MUA.
This commit is contained in:
iequidoo
2025-09-16 03:55:31 -03:00
parent f461b8d9ca
commit 1ab149f528
3 changed files with 13 additions and 18 deletions

View File

@@ -70,11 +70,10 @@ def test_markseen_message_and_mdn(acfactory, direct_imap):
rex = re.compile("Marked messages [0-9]+ in folder INBOX as seen.")
for ac in ac1, ac2:
while True:
event = ac.wait_for_event()
if event.kind == EventType.INFO and rex.search(event.msg):
break
while True:
event = ac2.wait_for_event()
if event.kind == EventType.INFO and rex.search(event.msg):
break
ac1_direct_imap = direct_imap(ac1)
ac2_direct_imap = direct_imap(ac2)
@@ -82,8 +81,8 @@ def test_markseen_message_and_mdn(acfactory, direct_imap):
ac1_direct_imap.select_folder("INBOX")
ac2_direct_imap.select_folder("INBOX")
# Check that the mdn is marked as seen
assert len(list(ac1_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 1
# Check that the mdn isn't marked as seen
assert len(list(ac1_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 0
# Check original message is marked as seen
assert len(list(ac2_direct_imap.conn.fetch(AND(seen=True), mark_seen=False))) == 1