[Mailman-Developers] Scrubber mungs Quoted Printable

Mark Sapiro msapiro at value.net
Sat Nov 5 18:49:22 CET 2005

A couple of posts on the mailman-users list
have pointed out that there is a problem with Scrubber.py.

The basic issue is that under some circumstances, the scrubbed message
is quoted-printable encoded, but Scrubber unconditionally adds a
'Content-Transfer-Encoding: 8bit' header resulting in garbled content
when the message is viewed.

The addition of the header was a small part of the patch at
and the associated comment is

  - Fixes a bug in the scrubber, where a
    content-transfer-encoding might have survived
    flattening of the message.

I think the fix for the current problem is the following patch -

--- mailman-2.1.6/Mailman/Handlers/Scrubber.py
+++ mailman-mas/Mailman/Handlers/Scrubber.py
@@ -376,9 +376,8 @@
         # Now join the text and set the payload
         sep = _('-------------- next part --------------\n')
         del msg['content-type']
-        msg.set_payload(sep.join(text), charset)
         del msg['content-transfer-encoding']
-        msg.add_header('Content-Transfer-Encoding', '8bit')
+        msg.set_payload(sep.join(text), charset)
     return msg

I have checked this with Tokio, and he agrees, but I don't have any
message that would have triggered the original bug to test against nor
do I know what the characteristics of such a message would be or if
subsequent changes in the Python email library have taken care of it.

Thus, before committing this patch, I'd like to see it get a bit more
exposure/testing and/or get feedback from someone who knows something
about the original bug.

Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Developers mailing list