From 82ed0668ce15834e49055b4503483c6602142e5a Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Thu, 23 Nov 2017 09:39:51 -0800 Subject: Ignore missing .db files when updating group and mode. --- Mailman/MTA/Postfix.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Mailman') diff --git a/Mailman/MTA/Postfix.py b/Mailman/MTA/Postfix.py index b829ad6e..6fa3f14a 100644 --- a/Mailman/MTA/Postfix.py +++ b/Mailman/MTA/Postfix.py @@ -56,7 +56,12 @@ def _update_maps(): if (stat[ST_MODE] & targetmode) <> targetmode: os.chmod(file, stat[ST_MODE] | targetmode) dbfile = file + '.db' - stat = os.stat(dbfile) + try: + stat = os.stat(dbfile) + except OSError, e: + if e.errno <> errno.ENOENT: + raise + return if (stat[ST_MODE] & targetmode) <> targetmode: os.chmod(dbfile, stat[ST_MODE] | targetmode) user = mm_cfg.MAILMAN_USER -- cgit v1.2.3 From 223590d493d2569ea18dbf0fa8b986cc63cafa30 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sat, 9 Dec 2017 16:17:47 -0800 Subject: Show match in hold reason for header_filter_rules. --- Mailman/Handlers/SpamDetect.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Mailman') diff --git a/Mailman/Handlers/SpamDetect.py b/Mailman/Handlers/SpamDetect.py index 257cdb24..4e554d70 100644 --- a/Mailman/Handlers/SpamDetect.py +++ b/Mailman/Handlers/SpamDetect.py @@ -56,7 +56,12 @@ class SpamDetected(Errors.DiscardMessage): """The message contains known spam""" class HeaderMatchHold(Errors.HoldMessage): - reason = _('The message headers matched a filter rule') + def __init__(self, pattern): + self.__pattern = pattern + + def reason_notice(self): + pattern = self.__pattern + return _('Header matched regexp: %(pattern)s') # And reset the translator @@ -195,6 +200,7 @@ error, contact the mailing list owner at %(listowner)s.""")) # pass it here but list-owner can set this to be # discarded on the GUI if he wants. return - hold_for_approval(mlist, msg, msgdata, HeaderMatchHold) + hold_for_approval( + mlist, msg, msgdata, HeaderMatchHold(pattern)) if action == mm_cfg.ACCEPT: return -- cgit v1.2.3 From 4199371d91101bba2c60e78ee428d646e0b6698f Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 29 Dec 2017 12:55:00 -0800 Subject: Removed a Python 2.7 dependency from pipermail.py. --- Mailman/Archiver/pipermail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Mailman') diff --git a/Mailman/Archiver/pipermail.py b/Mailman/Archiver/pipermail.py index c03d43b3..9b0813b0 100644 --- a/Mailman/Archiver/pipermail.py +++ b/Mailman/Archiver/pipermail.py @@ -249,8 +249,8 @@ class Article: if date is None: date = floatdate(message.get('x-list-received-date')) if date is None: - date = floatdate(re.sub(r'^.*;\s*', '', - message.get('received', ''), flags=re.S)) + rec_re = re.compile(r'^.*;\s*', re.DOTALL) + date = floatdate(rec_re.sub('', message.get('received', ''))) if date is None: date = floatdate(re.sub(r'From \s*\S+\s+', '', message.get_unixfrom() or '' )) -- cgit v1.2.3