From 48f2c4e14b56cebbfa604bcad188a03110d08a55 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 30 Apr 2022 12:55:51 +0000 Subject: [PATCH] Correctly escape messages consisting of a dot in SMTP protocol Actual bugfix is in the async-smtp crate. --- Cargo.lock | 2 +- python/tests/test_account.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index e3485d86d..95377eb0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,7 +297,7 @@ dependencies = [ [[package]] name = "async-smtp" version = "0.4.0" -source = "git+https://github.com/async-email/async-smtp?branch=master#3e7a8f3de19fdeb19d14cf123a8696c49685d3fa" +source = "git+https://github.com/async-email/async-smtp?branch=master#0cbf7043923b06612ce0dea7a3a3dae5ceaef578" dependencies = [ "async-native-tls", "async-std", diff --git a/python/tests/test_account.py b/python/tests/test_account.py index 45ea3605f..ba86ac6b2 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -960,6 +960,18 @@ class TestOnlineAccount: chat.send_text("hello") ac1._evtracker.get_matching("DC_EVENT_SMTP_MESSAGE_SENT") + def test_send_dot(self, acfactory, lp): + """Test that a single dot is properly escaped in SMTP protocol""" + ac1, ac2 = acfactory.get_two_online_accounts() + chat = acfactory.get_accepted_chat(ac1, ac2) + + lp.sec("sending message") + msg_out = chat.send_text(".") + + lp.sec("receiving message") + msg_in = ac2._evtracker.wait_next_incoming_message() + assert msg_in.text == msg_out.text + def test_send_and_receive_message_markseen(self, acfactory, lp): ac1, ac2 = acfactory.get_two_online_accounts()