aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2016-05-26 08:42:36 -0700
committerMark Sapiro <mark@msapiro.net>2016-05-26 08:42:36 -0700
commit56f0630cb0c72e1c39b3e5b738313f9dc95494c2 (patch)
treed6c3ef70a3ca4ea61007cb35e7a4ea57d9f45885 /Mailman
parentf48bbb2d2f440eeacf2abe422decd5d7790c0e00 (diff)
parent3d438eb9d0e1ba573ea1551270796ef355ea4dc7 (diff)
downloadmailman2-56f0630cb0c72e1c39b3e5b738313f9dc95494c2.tar.gz
mailman2-56f0630cb0c72e1c39b3e5b738313f9dc95494c2.tar.xz
mailman2-56f0630cb0c72e1c39b3e5b738313f9dc95494c2.zip
REMOVE_DKIM_HEADERS = 3 renames headers X-Mailman-Original...
Diffstat (limited to 'Mailman')
-rwxr-xr-xMailman/Defaults.py.in4
-rw-r--r--Mailman/Handlers/CleanseDKIM.py7
2 files changed, 10 insertions, 1 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in
index 3569cc07..4ae5633f 100755
--- a/Mailman/Defaults.py.in
+++ b/Mailman/Defaults.py.in
@@ -616,8 +616,10 @@ NNTP_REWRITE_DUPLICATE_HEADERS = [
# broken and even if the outgoing message is resigned. However, some sites
# may wish to remove these headers. Possible values and meanings are:
# No, 0, False -> do not remove headers.
-# Yes, 1, True -> remove headers only if the list's from_is_list setting is 1.
+# Yes, 1, True -> remove headers only if we are munging the from header due
+# to from_is_list or dmarc_moderation_action.
# 2 -> always remove headers.
+# 3 -> always remove, rename and preserve original DKIM headers.
REMOVE_DKIM_HEADERS = No
# All `normal' messages which are delivered to the entire list membership go
diff --git a/Mailman/Handlers/CleanseDKIM.py b/Mailman/Handlers/CleanseDKIM.py
index 2cfb07af..d74db7fe 100644
--- a/Mailman/Handlers/CleanseDKIM.py
+++ b/Mailman/Handlers/CleanseDKIM.py
@@ -43,6 +43,13 @@ def process(mlist, msg, msgdata):
)
):
return
+ if (mm_cfg.REMOVE_DKIM_HEADERS == 3):
+ for value in msg.get_all('domainkey-signature', []):
+ msg['X-Mailman-Original-DomainKey-Signature'] = value
+ for value in msg.get_all('dkim-signature', []):
+ msg['X-Mailman-Original-DKIM-Signature'] = value
+ for value in msg.get_all('authentication-results', []):
+ msg['X-Mailman-Original-Authentication-Results'] = value
del msg['domainkey-signature']
del msg['dkim-signature']
del msg['authentication-results']