Broken unicode e-mails corrupt mailman's held message queue
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mailman3 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Dear Maintainers,
there's a bug in the Mailman3 package that leads to a corrupted held
messages queue. The problem manifests itself by a 500 server error when
the list administrator tries to access the respective list's "held
messages" panel in Postorius. Expected behaviour is that the held
messages queue is shown.
Details of the problem can be found in this thread:
https://<email address hidden>
Summary: If Mailman is served via Postfix, and Postfix has set the
"smtputf8_enable" configuration option set to "yes" (which as of Postfix
3.0.0 is the default value), then e-mail messages with broken Unicode
content are changed to include the U+FFFD REPLACEMENT CHARACTER. Such
broken messages are usually spam messages from non-members, and thus end
up in the held messages queue. There the U+FFFD character hits a bug in
Mailman3's e-mail processor, causing it to crash with a
UnicodeEncodeError, thus leading to the 500 server error when accessing
the held messages queue.
Once the corrupt message is in the held messages queue, there's no easy
way to remove it from it again. Remedies can be found in the linked
mailing list thread.
The problem is known upstream and has been fixed:
https:/
https:/
It's an underlying problem in Python itself, reported here:
https:/
For the record, this is the exception found in mailman.log:
Dec 09 13:21:04 2019 (3090) REST request handler error:
Traceback (most recent call last):
File "/usr/lib/
self.result = application(
File "/usr/lib/
wrapper
rtn = function(*args, **kws)
File "/usr/lib/
return super()
File "falcon/api.py", line 215, in falcon.
File "falcon/api.py", line 189, in falcon.
File "/usr/lib/
on_get
resource = self._make_
File "/usr/lib/
_make_collection
for resource in collection]
File "/usr/lib/
<listcomp>
for resource in collection]
File "/usr/lib/
_resource_as_dict
resource = self._make_
File "/usr/lib/
_make_resource
resource['msg'] = msg.as_string()
File "/usr/lib/
g.flatten(self, unixfrom=unixfrom)
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
meth(msg)
File "/usr/lib/
msg.
File "/usr/lib/
payload = payload.
UnicodeEncodeError: 'ascii' codec can't encode character '\ufffd' in position 269: ordinal
not in range(128)
Please backport this fix. A corrupted held messages queue makes the
moderation of e-mails impossible.
Package mailman3 version: 3.1.1-9
Best Regards,
Lauri Ojansivu
Status changed to 'Confirmed' because the bug affects multiple users.