[Mailman-Users] yet another message filtering question

Mark Sapiro mark at msapiro.net
Mon Dec 29 17:42:59 CET 2008

Alex wrote:

>What would be the best way (if there is one) in Mailman to remove all 
>attachments before maximum message size value sends the message to moderator 
>for approval?.
>I have read archives about demime and stripmime but perl and other scripts 
>make me nervous - i am not very good at this stuff and don't even know where 
>to begin.

The issue you see arises because the Hold handler which enforces the
maximum message size comed earlier in the handler pipeline than the
MimeDel handler which does content filtering.

What I do for my production site is add the following lines to 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')

(Only the last two are required. The first 4 are documentation of
what's being done).

The result of this is the message is not held if content filtering
reduces its size below the max. Also, any messages held for
'miscellaneous' reasons have already been content filtered, but
messages held for 'membership' reasons (non-member or moderated
member) will be content filtered after approval.

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