aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers
diff options
context:
space:
mode:
authorYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-03-02 18:57:16 +0900
committerYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-03-02 18:57:16 +0900
commit3d3ed445c841f40e793e733956ab65287ca5cfe1 (patch)
treef54b733b0a6a3353cb595d6c4664689ea5bf8a3f /Mailman/Handlers
parent7bee928877b9771072c32c47912b346b41ce3c35 (diff)
parent8f22ba21a32701d2efaac0b8b1a1c0a4522912b0 (diff)
downloadmailman2-3d3ed445c841f40e793e733956ab65287ca5cfe1.tar.gz
mailman2-3d3ed445c841f40e793e733956ab65287ca5cfe1.tar.xz
mailman2-3d3ed445c841f40e793e733956ab65287ca5cfe1.zip
Update to lp:mailman/2.1 rev 1629 (no difference against the original branch
Diffstat (limited to 'Mailman/Handlers')
-rw-r--r--Mailman/Handlers/Cleanse.py5
-rwxr-xr-xMailman/Handlers/CookHeaders.py4
-rw-r--r--Mailman/Handlers/MimeDel.py7
3 files changed, 13 insertions, 3 deletions
diff --git a/Mailman/Handlers/Cleanse.py b/Mailman/Handlers/Cleanse.py
index c684cd19..5270bb5a 100644
--- a/Mailman/Handlers/Cleanse.py
+++ b/Mailman/Handlers/Cleanse.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2015 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2016 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
@@ -60,6 +60,9 @@ def process(mlist, msg, msgdata):
del msg['x-approve']
# Also remove this header since it can contain a password
del msg['urgent']
+ # If we're anonymizing, we need to save the sender here, and we may as
+ # well do it for all.
+ msgdata['original_sender'] = msg.get_sender()
# We remove other headers from anonymous lists
if mlist.anonymous_list:
syslog('post', 'post to %s from %s anonymized',
diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py
index 8b371b77..59eb67b7 100755
--- a/Mailman/Handlers/CookHeaders.py
+++ b/Mailman/Handlers/CookHeaders.py
@@ -98,7 +98,9 @@ def process(mlist, msg, msgdata):
# message, we want to save some of the information in the msgdata
# dictionary for later. Specifically, the sender header will get waxed,
# but we need it for the Acknowledge module later.
- msgdata['original_sender'] = msg.get_sender()
+ # We may have already saved it; if so, don't clobber it here.
+ if 'original_sender' not in msgdata:
+ msgdata['original_sender'] = msg.get_sender()
# VirginRunner sets _fasttrack for internally crafted messages.
fasttrack = msgdata.get('_fasttrack')
if not msgdata.get('isdigest') and not fasttrack:
diff --git a/Mailman/Handlers/MimeDel.py b/Mailman/Handlers/MimeDel.py
index ab7483ba..691a6e85 100644
--- a/Mailman/Handlers/MimeDel.py
+++ b/Mailman/Handlers/MimeDel.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2011 by the Free Software Foundation, Inc.
+# Copyright (C) 2002-2016 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
@@ -210,6 +210,11 @@ def recast_multipart(msg):
# If we're left with a multipart message with only one sub-part, recast
# the message to just the sub-part, but not if the part is message/rfc822
# because we don't want to lose the headers.
+ # Also, if this is a multipart/signed part, stop now as the original part
+ # may have had a multipart sub-part with only one sub-sub-part, the sig
+ # may still be valid and going further may break it. (LP: #1551075)
+ if msg.get_content_type() == 'multipart/signed':
+ return
if msg.is_multipart():
if (len(msg.get_payload()) == 1 and
msg.get_content_type() <> 'message/rfc822'):