stops processing new mail for a list after receiving attachment with ' in filename
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mailman (Ubuntu) |
Fix Released
|
High
|
Martin Pitt |
Bug Description
Today, the launchpad development list, hosted on the Canonical server lists.canonical
New messages were "shunted" by Mailman.
Here's a relevant part of the traceback.
File "/var/lib/
fnext = os.path.
File "/usr/lib/
filename = self.get_
File "/usr/lib/
for k, v in self._get_
File "/usr/lib/
params = Utils.decode_
File "/usr/lib/
charset, language, value = decode_
File "/usr/lib/
charset, language, s = parts
ValueError: need more than 2 values to unpack
The bug is actually in the email package of the python standard library. It is failing to properly handle the contents of the Content-
If this problem is hacked around, you get another traceback of the same issue in a different place.
File "/var/lib/
url = save_attachment
File "/var/lib/
filename = msg.get_filename()
File "/usr/lib/
filename = self.get_
File "/usr/lib/
for k, v in self._get_
File "/usr/lib/
params = Utils.decode_
File "/usr/lib/
charset, language, value = decode_
File "/usr/lib/
charset, language, s = parts
ValueError: need more than 2 values to unpack
Hacking around this one fixed the issue on the Canonical servers. However, the call to get_filename() is also present in other code paths, apparently when the atachment is not multi-part MIME.
I'll attach a patch that works around all three cases.
This patch catches ValueError exceptions from the email package of the standard library and allows Mailman to continue with an appropriate fall-back value.