From a72747841df20c99dacb8c7033cc10c04c9a82fe Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 21 Aug 2015 09:26:28 -0700 Subject: Implemented GLOBAL_BAN_LIST. --- Mailman/Defaults.py.in | 8 ++++++++ Mailman/MailList.py | 4 +++- NEWS | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index 9e9e93af..3bb9bc13 100755 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -131,6 +131,14 @@ SUBSCRIBE_FORM_SECRET = None # test. SUBSCRIBE_FORM_MIN_TIME = seconds(5) +# Installation wide ban list. This is a list, one entry per line, of email +# addresses and regexp patterns (beginning with ^) which are not allowed to +# subscribe to any lists in the installation. This supplements the individual +# list's ban_list. For example, to ban xxx@aol.com and any @gmail.com address +# beginning with yyy, set +# GLOBAL_BAN_LIST = ['xxx@aol.com', '^yyy.*@gmail.com'] +GLOBAL_BAN_LIST = [] + # Command that is used to convert text/html parts into plain text. This # should output results to standard output. %(filename)s will contain the # name of the temporary file that the program should operate on. diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 6404666a..2095d107 100755 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -1564,7 +1564,9 @@ bad regexp in bounce_matching_header line: %s """Returns matched entry in ban_list if email matches. Otherwise returns None. """ - return self.GetPattern(email, self.ban_list) + return (self.GetPattern(email, self.ban_list) or + self.GetPattern(email, mm_cfg.GLOBAL_BAN_LIST) + ) def HasAutoApprovedSender(self, sender): """Returns True and logs if sender matches address or pattern diff --git a/NEWS b/NEWS index 72c195af..980b3c2c 100755 --- a/NEWS +++ b/NEWS @@ -7,6 +7,12 @@ Here is a history of user visible changes to Mailman. 2.1.21 (xx-xxx-xxxx) + New Features + + - There is now a mm_cfg.py setting GLOBAL_BAN_LIST which is like the + individual list's ban_list but applies globally to all subscribe + requests. See the description in Defaults.py for more details. + i18n - The Brazilian Portugese translation has been updated by Emerson Ribeiro -- cgit v1.2.3