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 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Mailman/Handlers') 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:' -- cgit v1.2.3