summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2015-09-06 18:31:31 -0400
committerBarry Warsaw2015-09-07 12:24:37 -0400
commit5b7c429a711572393dbce42cbce47d785fe6e3a6 (patch)
treed8df12c2058d98fc5ec34a942d0f8a127dd697cc /src
parent45be4dc53dcdf39af119df62db458f948fa94911 (diff)
downloadmailman-5b7c429a711572393dbce42cbce47d785fe6e3a6.tar.gz
mailman-5b7c429a711572393dbce42cbce47d785fe6e3a6.tar.zst
mailman-5b7c429a711572393dbce42cbce47d785fe6e3a6.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.rst2
-rw-r--r--src/mailman/runners/tests/test_lmtp.py16
2 files changed, 18 insertions, 0 deletions
diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst
index 29ab5d0ef..a67d4a2d0 100644
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -33,6 +33,8 @@ Bugs
* For now, treat `DeliveryMode.summary_digests` the same as `.mime_digests`.
(Closes #141). Also, don't enqueue a particular digest if there are no
recipients for that digest.
+ * 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>')