------------------------------------------------------------
revno: 1173
committer: Mark Sapiro <msap...@value.net>
branch nick: 2.2
timestamp: Thu 2011-06-02 11:08:43 -0700
message:
  Fixed a problem which could result in raw, undecoded message bodies
  appearing in plain digests and archives.  Bug #787790.
modified:
  Mailman/Handlers/Scrubber.py
  NEWS


--
lp:mailman/2.2
https://code.launchpad.net/~mailman-coders/mailman/2.2

Your team Mailman Checkins is subscribed to branch lp:mailman/2.2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.2/+edit-subscription
=== modified file 'Mailman/Handlers/Scrubber.py'
--- Mailman/Handlers/Scrubber.py	2009-12-04 01:06:11 +0000
+++ Mailman/Handlers/Scrubber.py	2011-06-02 18:08:43 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2009 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2011 by the Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -314,7 +314,7 @@
     # We still have to sanitize multipart messages to flat text because
     # Pipermail can't handle messages with list payloads.  This is a kludge;
     # def (n) clever hack ;).
-    if msg.is_multipart() and sanitize <> 2:
+    if msg.is_multipart():
         # By default we take the charset of the first text/plain part in the
         # message, but if there was none, we'll use the list's preferred
         # language's charset.
@@ -335,9 +335,12 @@
             # MAS test payload - if part may fail if there are no headers.
             if not part.get_payload() or part.is_multipart():
                 continue
-            # All parts should be scrubbed to text/plain by now.
+            # All parts should be scrubbed to text/plain by now, except
+            # if sanitize == 2, there could be text/html parts so keep them
+            # but skip any other parts.
             partctype = part.get_content_type()
-            if partctype <> 'text/plain':
+            if partctype <> 'text/plain' and (partctype <> 'text/html' or
+                                              sanitize <> 2):
                 text.append(_('Skipped content of type %(partctype)s\n'))
                 continue
             try:

=== modified file 'NEWS'
--- NEWS	2011-05-11 01:59:39 +0000
+++ NEWS	2011-06-02 18:08:43 +0000
@@ -125,6 +125,9 @@
 
   Bug Fixes and other patches
 
+    - Fixed a problem which could result in raw, undecoded message bodies
+      appearing in plain digests and archives.  Bug #787790.
+
     - Fixed a problem in admindb.py where the character set for the display of
       the message body excerpt was not correctly determined.  Bug #779751.
 

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to