------------------------------------------------------------ revno: 1196 committer: Mark Sapiro <msap...@value.net> branch nick: 2.2 timestamp: Thu 2011-11-17 13:00:25 -0800 message: Fixed a problem where topics regexps would not match RFC 2047 encoded Keywords: and/or Subject: headers. Bug #891676. modified: Mailman/Handlers/Tagger.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/Tagger.py' --- Mailman/Handlers/Tagger.py 2008-12-03 01:11:33 +0000 +++ Mailman/Handlers/Tagger.py 2011-11-17 21:00:25 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2008 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 @@ -23,6 +23,9 @@ import email.Iterators import email.Parser +from email.Header import decode_header + +from Mailman import Utils from Mailman.Logging.Syslog import syslog OR = '|' @@ -35,10 +38,16 @@ def process(mlist, msg, msgdata): if not mlist.topics_enabled: return + # Helper function. Return RFC 2047 decoded header as a string in the + # charset of the list's preferred language. + def _decode(h): + if not h: + return h + return Utils.oneline(h, Utils.GetCharSet(mlist.preferred_language)) # Extract the Subject:, Keywords:, and possibly body text matchlines = [] - matchlines.append(msg.get('subject', None)) - matchlines.append(msg.get('keywords', None)) + matchlines.append(_decode(msg.get('subject', None))) + matchlines.append(_decode(msg.get('keywords', None))) if mlist.topics_bodylines_limit == 0: # Don't scan any body lines pass @@ -86,7 +95,7 @@ # the first numlines of body text. lines = [] lineno = 0 - reader = list(email.Iterators.body_line_iterator(msg)) + reader = list(email.Iterators.body_line_iterator(msg, decode=True)) while numlines is None or lineno < numlines: try: line = reader.pop(0) === modified file 'NEWS' --- NEWS 2011-11-14 00:50:34 +0000 +++ NEWS 2011-11-17 21:00:25 +0000 @@ -127,6 +127,9 @@ Bug Fixes and other patches + - Fixed a problem where topics regexps would not match RFC 2047 encoded + Keywords: and/or Subject: headers. Bug #891676. + - Fixed misleading response to an email approval of a held message. Bug #889968.
_______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org