aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2017-12-09 16:17:47 -0800
committerMark Sapiro <mark@msapiro.net>2017-12-09 16:17:47 -0800
commit223590d493d2569ea18dbf0fa8b986cc63cafa30 (patch)
treef8ff350d28b9db55127efd3f9a81e825303f283d
parent82ed0668ce15834e49055b4503483c6602142e5a (diff)
downloadmailman2-223590d493d2569ea18dbf0fa8b986cc63cafa30.tar.gz
mailman2-223590d493d2569ea18dbf0fa8b986cc63cafa30.tar.xz
mailman2-223590d493d2569ea18dbf0fa8b986cc63cafa30.zip
Show match in hold reason for header_filter_rules.
-rw-r--r--Mailman/Handlers/SpamDetect.py10
-rw-r--r--NEWS3
2 files changed, 11 insertions, 2 deletions
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
diff --git a/NEWS b/NEWS
index c8b7f347..07d50655 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,9 @@ Here is a history of user visible changes to Mailman.
Bug fixes and other patches
+ - Messages held for header_filter_rules now show the matched regexp in
+ the hold reason. (LP: #1737371)
+
- When updating the group and mode of a .db file with Mailman's Postfix
integration, a missing file is ignored. (LP: #1734162)