aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2013-07-19 12:24:22 -0700
committerMark Sapiro <mark@msapiro.net>2013-07-19 12:24:22 -0700
commit037acd8e92f42f86f5086a570a23466c128fc480 (patch)
tree037f431c99cd1ee3b426e0825f36b7c4194d2684
parentca48001a003aa2f19602fac2b2037ec7b49a7061 (diff)
downloadmailman2-037acd8e92f42f86f5086a570a23466c128fc480.tar.gz
mailman2-037acd8e92f42f86f5086a570a23466c128fc480.tar.xz
mailman2-037acd8e92f42f86f5086a570a23466c128fc480.zip
Second cut at the author_is_list feature.
Diffstat (limited to '')
-rwxr-xr-xMailman/Defaults.py.in4
-rw-r--r--Mailman/Gui/General.py24
-rw-r--r--Mailman/Handlers/Cleanse.py3
-rw-r--r--Mailman/Handlers/CleanseDKIM.py4
-rwxr-xr-xMailman/Handlers/CookHeaders.py3
-rwxr-xr-xNEWS3
6 files changed, 28 insertions, 13 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in
index f87f6665..ee17d344 100755
--- a/Mailman/Defaults.py.in
+++ b/Mailman/Defaults.py.in
@@ -108,6 +108,10 @@ ALLOW_SITE_ADMIN_COOKIES = No
# expire that many seconds following their last use.
AUTHENTICATION_COOKIE_LIFETIME = 0
+# The following must be set to Yes to enable the 'author is list' feature.
+# See DEFAULT_AUTHOR_IS_LIST below.
+ALLOW_AUTHOR_IS_LIST = No
+
# Form lifetime is set against Cross Site Request Forgery.
FORM_LIFETIME = hours(1)
diff --git a/Mailman/Gui/General.py b/Mailman/Gui/General.py
index 53f2e908..d28fe311 100644
--- a/Mailman/Gui/General.py
+++ b/Mailman/Gui/General.py
@@ -153,15 +153,21 @@ class General(GUIBase):
directive. eg.; [listname %%d] -> [listname 123]
(listname %%05d) -> (listname 00123)
""")),
+ ]
- ('author_is_list', mm_cfg.Radio, (_('No'), _('Yes')), 0,
- _("""Replace the sender with the list address to conform with
- policies like ADSP and DMARC. It replaces the poster's address
- in the From: header with the list address and adds the poster to
- the Reply-To: header, but the anonymous_list and Reply-To: header
- munging settings below take priority. If setting this to Yes,
- it is advised to set the MTA to DKIM sign all emails.""")),
-
+ if mm_cfg.ALLOW_AUTHOR_IS_LIST:
+ rtn.append(
+ ('author_is_list', mm_cfg.Radio, (_('No'), _('Yes')), 0,
+ _("""Replace the sender with the list address to conform with
+ policies like ADSP and DMARC. It replaces the poster's
+ address in the From: header with the list address and adds the
+ poster to the Reply-To: header, but the anonymous_list and
+ Reply-To: header munging settings below take priority. If
+ setting this to Yes, it is advised to set the MTA to DKIM sign
+ all emails."""))
+ )
+
+ rtn.extend([
('anonymous_list', mm_cfg.Radio, (_('No'), _('Yes')), 0,
_("""Hide the sender of a message, replacing it with the list
address (Removes From, Sender and Reply-To fields)""")),
@@ -382,7 +388,7 @@ class General(GUIBase):
useful for selecting among alternative names of a host that has
multiple addresses.""")),
- ]
+ ])
if mm_cfg.ALLOW_RFC2369_OVERRIDES:
rtn.append(
diff --git a/Mailman/Handlers/Cleanse.py b/Mailman/Handlers/Cleanse.py
index 678f6b56..c1b500e5 100644
--- a/Mailman/Handlers/Cleanse.py
+++ b/Mailman/Handlers/Cleanse.py
@@ -21,6 +21,7 @@ import re
from email.Utils import formataddr, getaddresses, parseaddr
+from Mailman import mm_cfg
from Mailman.Utils import unique_message_id
from Mailman.Logging.Syslog import syslog
from Mailman.Handlers.CookHeaders import uheader
@@ -40,7 +41,7 @@ def process(mlist, msg, msgdata):
del msg['urgent']
# Do we change the from so the list takes ownership of the email
# This really belongs in CookHeaders.
- if mlist.author_is_list:
+ if mm_cfg.ALLOW_AUTHOR_IS_LIST and mlist.author_is_list:
realname, email = parseaddr(msg['from'])
replies = getaddresses(msg.get('reply-to', ''))
reply_addrs = [x[1].lower() for x in replies]
diff --git a/Mailman/Handlers/CleanseDKIM.py b/Mailman/Handlers/CleanseDKIM.py
index 3a157890..c492a096 100644
--- a/Mailman/Handlers/CleanseDKIM.py
+++ b/Mailman/Handlers/CleanseDKIM.py
@@ -31,7 +31,9 @@ from Mailman import mm_cfg
def process(mlist, msg, msgdata):
if not mm_cfg.REMOVE_DKIM_HEADERS:
return
- if mm_cfg.REMOVE_DKIM_HEADERS == 1 and not mlist.author_is_list:
+ if (mm_cfg.ALLOW_AUTHOR_IS_LIST and
+ mm_cfg.REMOVE_DKIM_HEADERS == 1 and
+ not mlist.author_is_list):
return
del msg['domainkey-signature']
del msg['dkim-signature']
diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py
index 7455dcc6..71534c11 100755
--- a/Mailman/Handlers/CookHeaders.py
+++ b/Mailman/Handlers/CookHeaders.py
@@ -160,7 +160,8 @@ def process(mlist, msg, msgdata):
# is already in From and Reply-To in this case and similarly for
# an 'author is list' list.
if mlist.personalize == 2 and mlist.reply_goes_to_list <> 1 \
- and not mlist.anonymous_list and not mlist.author_is_list:
+ and not mlist.anonymous_list and not (mlist.author_is_list and
+ mm_cfg.ALLOW_AUTHOR_IS_LIST):
# Watch out for existing Cc headers, merge, and remove dups. Note
# that RFC 2822 says only zero or one Cc header is allowed.
new = []
diff --git a/NEWS b/NEWS
index c82cdec2..c2e93b73 100755
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,8 @@ Here is a history of user visible changes to Mailman.
compatability with DMARC and or ADSP. There is a new mm_cfg.py setting
DEFAULT_AUTHOR_IS_LIST to control the default for new lists, and the
existing REMOVE_DKIM_HEADERS setting has been extended to allow removing
- those headers only for author_is_list = Yes lists.
+ those headers only for author_is_list = Yes lists. This feature must be
+ enabled by setting ALLOW_AUTHOR_IS_LIST to Yes in mm_cfg.py.
- There is a new DISPLAY_HELD_SUMMARY_SORT_BUTTONS setting which if set
to Yes in mm_cfg.py will display a set of radio buttons in the admindb