On 4/14/22 10:29, Andre de Azevedo Cunha wrote:
Hi!
I'm testing the migration of my mailman2 lists to mailman3. Had made the adjustment below to discard messages larger than the list size limit. But I'm having difficulties to implement the same solution in mailman3. How could I do this?
something like ``` diff --git a/src/mailman/chains/builtin.py b/src/mailman/chains/builtin.py index ecb56d67f..ba3a3b4bc 100644 --- a/src/mailman/chains/builtin.py +++ b/src/mailman/chains/builtin.py @@ -59,7 +59,7 @@ class BuiltInChain: ('administrivia', LinkAction.defer, None), ('implicit-dest', LinkAction.defer, None), ('max-recipients', LinkAction.defer, None), - ('max-size', LinkAction.defer, None), + ('max-size', LinkAction.jump, 'reject'), ('news-moderation', LinkAction.defer, None), ('no-subject', LinkAction.defer, None), ('digests', LinkAction.defer, None), diff --git a/src/mailman/rules/max_size.py b/src/mailman/rules/max_size.py index 50de9ff5d..53cb3ae50 100644 --- a/src/mailman/rules/max_size.py +++ b/src/mailman/rules/max_size.py @@ -65,7 +65,9 @@ class MaximumSize: 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)) + (_('Your message was rejected because is bigger than the ' + 'list max value ({} Kb), please reduce the message to ' + 'below {} KB and try again.').format( + test_size, mlist.max_message_size))) return True return False ``` -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan