------------------------------------------------------------
revno: 1424
fixes bug: https://launchpad.net/bugs/1235101
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Mon 2013-10-07 21:57:09 -0700
message:
  - Fixed a crash in SpamDetect.py which caused messages with unparseable
    RFC 2047 encoded headers to be shunted.  (LP: #1235101)
modified:
  Mailman/Handlers/SpamDetect.py
  NEWS


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

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Handlers/SpamDetect.py'
--- Mailman/Handlers/SpamDetect.py	2012-02-05 21:37:29 +0000
+++ Mailman/Handlers/SpamDetect.py	2013-10-08 04:57:09 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2012 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2013 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
@@ -27,6 +27,7 @@
 
 import re
 
+from email.Errors import HeaderParseError
 from email.Header import decode_header
 
 from Mailman import mm_cfg
@@ -68,7 +69,10 @@
     headers = ''
     for h, v in msg.items():
         uvalue = u''
-        v = decode_header(re.sub('\n\s', ' ', v))
+        try:
+            v = decode_header(re.sub('\n\s', ' ', v))
+        except HeaderParseError:
+            v = [(v, 'us-ascii')]
         for frag, cs in v:
             if not cs:
                 cs = 'us-ascii'

=== modified file 'NEWS'
--- NEWS	2013-10-03 14:34:59 +0000
+++ NEWS	2013-10-08 04:57:09 +0000
@@ -83,6 +83,9 @@
 
   Bug Fixes and other patches
 
+    - Fixed a crash in SpamDetect.py which caused messages with unparseable
+      RFC 2047 encoded headers to be shunted.  (LP: #1235101)
+
     - Fixed cron/disabled to send a fresh cookie when notifying disabled
       members.  (LP: #1203200)
 

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

Reply via email to