From e858fca356364ca7bd1e0b54550ee29f6e5103b3 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 20 May 2021 02:03:47 +0300 Subject: [PATCH] dc_receive_imf: add python test for server-side message moving There was a bugreport for previous versions of DC that BCC-self messages are not marked as seen if server-side Sieve rule moves them. This test is an unsuccessful attempt to reproduce the bug, which was confirmed to be fixed. --- python/tests/test_account.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/python/tests/test_account.py b/python/tests/test_account.py index 243a91d7b..6b6f6220c 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -1033,6 +1033,33 @@ class TestOnlineAccount: except queue.Empty: pass # mark_seen_messages() has generated events before it returns + def test_moved_markseen(self, acfactory, lp): + """Test that message already moved to DeltaChat folder is marked as seen.""" + ac1 = acfactory.get_online_configuring_account(mvbox=True, config={"inbox_watch": "0"}) + ac2 = acfactory.get_online_configuring_account() + acfactory.wait_configure_and_start_io([ac1, ac2]) + ac1.set_config("bcc_self", "1") + + ac1.direct_imap.idle_start() + ac1.create_chat(ac2).send_text("Hello!") + ac1.direct_imap.idle_check(terminate=True) + ac1.stop_io() + + # Emulate moving of the message to DeltaChat folder by Sieve rule. + # mailcow server contains this rule by default. + ac1.direct_imap.conn.move(["*"], "DeltaChat") + + ac1.direct_imap.select_folder("DeltaChat") + ac1.direct_imap.idle_start() + ac1.start_io() + ac1.direct_imap.idle_wait_for_seen() + ac1.direct_imap.idle_done() + + fetch = list(ac1.direct_imap.conn.fetch("*", b'FLAGS').values()) + flags = fetch[-1][b'FLAGS'] + is_seen = b'\\Seen' in flags + assert is_seen + def test_message_override_sender_name(self, acfactory, lp): ac1, ac2 = acfactory.get_two_online_accounts() chat = acfactory.get_accepted_chat(ac1, ac2)