diff options
| author | Barry Warsaw | 2017-07-26 23:24:18 +0000 |
|---|---|---|
| committer | Barry Warsaw | 2017-07-26 23:24:18 +0000 |
| commit | ade94e8f833a9472ba9be52a08f4e2f381e7a212 (patch) | |
| tree | 5fba570b0c6f4c0919009cb6f455c18bc732192a /src/mailman/rules/max_size.py | |
| parent | 02826321d0430d7ffc1f674eeff4221941689ef7 (diff) | |
| parent | bea94cb9538a55b1376afd42c2ce751efce62cfe (diff) | |
| download | mailman-ade94e8f833a9472ba9be52a08f4e2f381e7a212.tar.gz mailman-ade94e8f833a9472ba9be52a08f4e2f381e7a212.tar.zst mailman-ade94e8f833a9472ba9be52a08f4e2f381e7a212.zip | |
Diffstat (limited to 'src/mailman/rules/max_size.py')
| -rw-r--r-- | src/mailman/rules/max_size.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mailman/rules/max_size.py b/src/mailman/rules/max_size.py index 46c8fc5ac..2554e0db0 100644 --- a/src/mailman/rules/max_size.py +++ b/src/mailman/rules/max_size.py @@ -39,4 +39,12 @@ class MaximumSize: assert hasattr(msg, 'original_size'), ( 'Message was not sized on initial parsing.') # The maximum size is specified in 1024 bytes. - return msg.original_size / 1024.0 > mlist.max_message_size + if msg.original_size / 1024.0 > mlist.max_message_size: + msgdata['moderation_sender'] = msg.sender + with _.defer_translation(): + # This will be translated at the point of use. + msgdata.setdefault('moderation_reasons', []).append( + (_('The message is larger than the {} KB maximum size'), + mlist.max_message_size)) + return True + return False |
