From cb608782958b80bad581ca173022e273fdc2bd66 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sun, 6 Sep 2015 18:31:31 -0400 Subject: For Python versions earlier than 3.5, use a compatibility layer for a backported smtpd module which can accept non-UTF-8 data. (Closes #140) --- src/mailman/docs/NEWS.rst | 2 ++ src/mailman/runners/tests/test_lmtp.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'src') diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst index 0f778c494..a26e13601 100644 --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -30,6 +30,8 @@ Bugs Abhilash Raj. (Closes #137) * The MHonArc archiver must set stdin=PIPE when calling the subprocess. Given by Walter Doekes. + * For Python versions earlier than 3.5, use a compatibility layer for a + backported smtpd module which can accept non-UTF-8 data. (Closes #140) Configuration ------------- diff --git a/src/mailman/runners/tests/test_lmtp.py b/src/mailman/runners/tests/test_lmtp.py index 08db8aa8f..1a6112e3c 100644 --- a/src/mailman/runners/tests/test_lmtp.py +++ b/src/mailman/runners/tests/test_lmtp.py @@ -170,3 +170,19 @@ Message-ID: self.assertEqual(len(messages), 1) self.assertEqual(messages[0].msgdata['listid'], 'my-list.example.com') + + def test_issue140(self): + # Non-UTF-8 data sent to the LMTP server crashes it. + with transaction(): + create_list('ant@example.com') + self._lmtp.sendmail('anne@example.com', ['ant@example.com'], b"""\ +From: anne@example.com +To: ant@example.com +Subject: My subject +Message-ID: + +\xa0 +""") + messages = get_queue_messages('in') + self.assertEqual(len(messages), 1) + self.assertEqual(messages[0].msg['message-id'], '') -- cgit v1.2.3-70-g09d2