Don't ignore incoming mails without Received-header

fix #2149
This commit is contained in:
Hocuri
2021-01-17 13:51:27 +01:00
parent 08c46af3aa
commit ccee289a5c
2 changed files with 18 additions and 17 deletions

View File

@@ -1134,9 +1134,10 @@ class TestOnlineAccount:
def test_dont_show_emails_in_draft_folder(self, acfactory):
"""Most mailboxes have a "Drafts" folder where constantly new emails appear but we don't actually want to show them.
So: If there is no Received header AND it's not in the sentbox, then ignore the email."""
So: If it's outgoing AND there is no Received header AND it's not in the sentbox, then ignore the email."""
ac1 = acfactory.get_online_configuring_account()
ac1.set_config("show_emails", "2")
ac1.create_contact("alice@example.com").create_chat()
acfactory.wait_configure(ac1)
ac1.direct_imap.create_folder("Drafts")
@@ -1148,23 +1149,23 @@ class TestOnlineAccount:
ac1.stop_io()
ac1.direct_imap.append("Drafts", """
From: Bob <bob@example.org>
From: ac1 <{}>
Subject: subj
To: alice@example.com
Message-ID: <aepiors@example.org>
Content-Type: text/plain; charset=utf-8
message in Drafts
""")
""".format(ac1.get_config("configured_addr")))
ac1.direct_imap.append("Sent", """
From: Bob <bob@example.org>
From: ac1 <{}>
Subject: subj
To: alice@example.com
Message-ID: <hsabaeni@example.org>
Content-Type: text/plain; charset=utf-8
message in Sent
""")
""".format(ac1.get_config("configured_addr")))
ac1.set_config("scan_all_folders_debounce_secs", "0")
ac1.start_io()