summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2015-09-04 22:49:33 -0400
committerBarry Warsaw2015-09-07 12:23:55 -0400
commit45be4dc53dcdf39af119df62db458f948fa94911 (patch)
tree1a5d914167933f1b9a6b2c1baa4c3a406fe2479a /src
parent9d784db1614c5481498ba1e04c0de6b07189fb12 (diff)
downloadmailman-45be4dc53dcdf39af119df62db458f948fa94911.tar.gz
mailman-45be4dc53dcdf39af119df62db458f948fa94911.tar.zst
mailman-45be4dc53dcdf39af119df62db458f948fa94911.zip
Don't decode bytes in smtpd. Pass them through to the email package so it can
convert them from bytes to message objects.
Diffstat (limited to 'src')
-rw-r--r--src/mailman/runners/lmtp.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mailman/runners/lmtp.py b/src/mailman/runners/lmtp.py
index 8a490d906..bd577803e 100644
--- a/src/mailman/runners/lmtp.py
+++ b/src/mailman/runners/lmtp.py
@@ -139,7 +139,7 @@ class Channel(smtpd.SMTPChannel):
"""An LMTP channel."""
def __init__(self, server, conn, addr):
- super().__init__(server, conn, addr)
+ super().__init__(server, conn, addr, decode_data=False)
# Stash this here since the subclass uses private attributes. :(
self._server = server
@@ -179,14 +179,14 @@ class LMTPRunner(Runner, smtpd.SMTPServer):
slog.debug('LMTP accept from %s', addr)
@transactional
- def process_message(self, peer, mailfrom, rcpttos, data):
+ def process_message(self, peer, mailfrom, rcpttos, data, **kwargs):
try:
# Refresh the list of list names every time we process a message
# since the set of mailing lists could have changed.
listnames = set(getUtility(IListManager).names)
# Parse the message data. If there are any defects in the
# message, reject it right away; it's probably spam.
- msg = email.message_from_string(data, Message)
+ msg = email.message_from_bytes(data, Message)
except Exception:
elog.exception('LMTP message parsing')
config.db.abort()