[Mailman-Users] override list owner ability to approve messagesover the max_message_size?

Mark Sapiro msapiro at value.net
Fri Oct 19 00:12:06 CEST 2007


Christopher Adams wrote:

>Is there a way to for a system override of the ability of list owners
>to approve messages that are larger than what they have set in
>max_message_size?


This would require changing the code in Mailman/Handlers/Hold.py. If
you want to do that, you'd find the code section

        if bodylen/1024.0 > mlist.max_message_size:
            hold_for_approval(mlist, msg, msgdata,
                              MessageTooBig(bodylen,
mlist.max_message_size))
            # no return


and if you want to just discard the messages, change it to

        if bodylen/1024.0 > mlist.max_message_size:
            raise Errors.DiscardMessage
            # no return

and if you want to reject the message, change it to something like

        if bodylen/1024.0 > mlist.max_message_size:
            raise Errors.RejectMessage, Utils.wrap(
                MessageTooBig(bodylen,
                    mlist.max_message_size).reason_notice())
            # no return

Note that the

                MessageTooBig(bodylen,
                    mlist.max_message_size).reason_notice())

above just creates the standard

Message body is too big: <bodylen> bytes with a limit of
<max_message_size> KB

message, but you could provide any message you want.

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list