From d5a48ae6a27174e6d9ce925d63b749b77db54582 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Wed, 16 Sep 2015 19:52:18 -0700 Subject: Subject prefixing could fail to collapse multiple 'Re:' in an incomming message if they all came after the list's subject_prefix. --- Mailman/Handlers/CookHeaders.py | 8 +++++++- NEWS | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py index 25fda890..63e630cb 100755 --- a/Mailman/Handlers/CookHeaders.py +++ b/Mailman/Handlers/CookHeaders.py @@ -380,7 +380,13 @@ def prefix_subject(mlist, msg, msgdata): else: old_style = mm_cfg.OLD_STYLE_PREFIXING subject = re.sub(prefix_pattern, '', subject) - rematch = re.match('((RE|AW|SV|VS)\s*(\[\d+\])?\s*:\s*)+', subject, re.I) + # Previously the following re didn't have the first \s*. It would fail + # if the incoming Subject: was like '[prefix] Re: Re: Re:' because of the + # leading space after stripping the prefix. It is not known what MUA would + # create such a Subject:, but the issue was reported. + rematch = re.match( + '(\s*(RE|AW|SV|VS)\s*(\[\d+\])?\s*:\s*)+', + subject, re.I) if rematch: subject = subject[rematch.end():] recolon = 'Re:' diff --git a/NEWS b/NEWS index 193e3fec..b9d022d6 100755 --- a/NEWS +++ b/NEWS @@ -20,6 +20,10 @@ Here is a history of user visible changes to Mailman. Bug fixes and other patches + - Subject prefixing could fail to collapse multiple 'Re:' in an incomming + message if they all came after the list's subject_prefix. This is now + fixed. (LP: #1496620) + - Defended against a user submitting URLs with query fragments or POST data containing multiple occurrences of the same variable. (LP: #1496632) -- cgit v1.2.3