[Mailman-Users] Automatic rejection on message size?

Mark Sapiro mark at msapiro.net
Fri Dec 11 16:33:53 CET 2009

John Todd wrote:
>  I see no obvious way that I can set a list (or the whole system, for  
>that matter) to auto-reject with a message based on size of the  
>message.  It would actually seem to me that this would be a desirable  
>setting to have overall - is there a recipe for modifying the filter/ 
>actions so that I can make this happen?  I'm not a python wizard (or  
>even neophyte) and I have very little understanding of the internals  
>of Mailman at this point, so I'd kindly ask that any hints someone has  
>to offer could be worded in a way that is approachable by a skilled  
>*NIX admin but not a developer or Mailman wizard.  :-)  Thanks!

The various miscellaneous holds including message size are only holds.
There is no setting to reject or discard messages exceeding the size

If you want to change this, you can do one of two things: You can
modify Mailman/Handlers/Hold.py to reject or discard, or you can add a
custom handler to do the rejection between Moderate and Hold (see

Also, if you are going to do this and you also do content filtering, it
is probably a good idea to rearrange the pipeline to put MimeDel
before hold or your custom handler so you are rejecting on the content
filtered size. This can be accomplished by putting the following lines
(comments optional) in mm_cfg.py

# Put MimeDel ahead of Hold so "too big" is based on content filtered
# message.
GLOBAL_PIPELINE.insert(GLOBAL_PIPELINE.index('Hold'), 'MimeDel')

Making the actions configurable is something that can be considered for
MM 3.

Mark Sapiro <mark at msapiro.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