Mark Sapiro pushed to branch master at GNU Mailman / Mailman Core
Commits: a74f84ab by Pavel Valach at 2021-09-01T14:57:09+00:00 Include header name in moderation reason for HeaderMatchRule - - - - - d9ab8e65 by Mark Sapiro at 2021-09-01T14:57:09+00:00 Merge branch 'headermatchrule-message' into 'master' Include header name in moderation reason for HeaderMatchRule Closes #785 See merge request mailman/mailman!914 - - - - - 3 changed files: - src/mailman/chains/headers.py - src/mailman/chains/tests/test_headers.py - src/mailman/docs/NEWS.rst Changes: ===================================== src/mailman/chains/headers.py ===================================== @@ -119,7 +119,7 @@ class HeaderMatchRule: # This will be translated at the point of use. msgdata.setdefault('moderation_reasons', []).append( (_('Header "{}" matched a header rule'), - str(value))) + str(self.header) + ": " + str(value))) return True return False ===================================== src/mailman/chains/tests/test_headers.py ===================================== @@ -492,7 +492,7 @@ body self.assertIsInstance(event, HoldEvent) self.assertEqual(msgdata['moderation_reasons'], [('Header "{}" matched a header rule', - 'Bad subject')]) + 'subject: Bad subject')]) def test_reject_returns_reason(self): # Test that a match with reject action returns a reason @@ -518,4 +518,4 @@ body self.assertIsInstance(event, RejectEvent) self.assertEqual(msgdata['moderation_reasons'], [('Header "{}" matched a header rule', - 'Bad subject')]) + 'subject: Bad subject')]) ===================================== src/mailman/docs/NEWS.rst ===================================== @@ -106,6 +106,8 @@ Bugs * Nonmember posts gated from usenet bypass nonmember moderation. (Closes #937) * VERPed vacation responses and similar are no longer scored as bounces. (Closes #939) +* If a message is held by a ``HeaderMatchRule``, the header name is now included + in the reason for hold. (Closes #785) Command line ------------ View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/34730d8486e7a71e60592ba76beced6bc98adc64...d9ab8e65e7bc5df944b5ab7da315201075ebda73 -- View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/34730d8486e7a71e60592ba76beced6bc98adc64...d9ab8e65e7bc5df944b5ab7da315201075ebda73 You're receiving this email because of your account on gitlab.com.
_______________________________________________ Mailman-checkins mailing list -- mailman-checkins@python.org To unsubscribe send an email to mailman-checkins-le...@python.org https://mail.python.org/mailman3/lists/mailman-checkins.python.org/ Member address: arch...@jab.org