diff options
| author | Barry Warsaw | 2015-09-06 18:31:31 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2015-09-06 18:31:31 -0400 |
| commit | cb608782958b80bad581ca173022e273fdc2bd66 (patch) | |
| tree | cba03cd3ea87b4160f2830ecbacff82c0917caaa /src | |
| parent | dd3b09190a7f34108ad43b66daac807a8b4d899a (diff) | |
| download | mailman-cb608782958b80bad581ca173022e273fdc2bd66.tar.gz mailman-cb608782958b80bad581ca173022e273fdc2bd66.tar.zst mailman-cb608782958b80bad581ca173022e273fdc2bd66.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/docs/NEWS.rst | 2 | ||||
| -rw-r--r-- | src/mailman/runners/tests/test_lmtp.py | 16 |
2 files changed, 18 insertions, 0 deletions
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: <alpha> 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: <alpha> + +\xa0 +""") + messages = get_queue_messages('in') + self.assertEqual(len(messages), 1) + self.assertEqual(messages[0].msg['message-id'], '<alpha>') |
