From bea94cb9538a55b1376afd42c2ce751efce62cfe Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Wed, 26 Jul 2017 08:11:33 -0700 Subject: Ensure all holds/rejects have a reason. --- src/mailman/rules/loop.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mailman/rules/loop.py') diff --git a/src/mailman/rules/loop.py b/src/mailman/rules/loop.py index ac4d00461..b50b55ed6 100644 --- a/src/mailman/rules/loop.py +++ b/src/mailman/rules/loop.py @@ -37,4 +37,11 @@ class Loop: # Has this message already been posted to this list? list_posts = set(value.strip().lower() for value in msg.get_all('list-post', [])) - return mlist.posting_address in list_posts + if mlist.posting_address in list_posts: + msgdata['moderation_sender'] = msg.sender + with _.defer_translation(): + # This will be translated at the point of use. + msgdata.setdefault('moderation_reasons', []).append( + _('Message has already been posted to this list')) + return True + return False -- cgit v1.2.3-70-g09d2