[Mailman-Users] Is it possible to filter what is archived?

Mike Peachey mike.peachey at jennic.com
Mon Aug 6 14:57:00 CEST 2007

Mark Sapiro wrote:
> Mark Sapiro wrote:
>> Make a custom handler (see
>> <http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.067.htp>)
>> that checks mlist.umbrella_list, and if true add an X-No-Archive:
>> header to the message. E.g.
>> def process(mlist, msg, msgdata):
>>    if mlist.umbrella_list:
>>        msg['X-No-Archive'] = 'Yes'
>> The handler has to be in the pipeline prior to 'ToArchive'.
> I should know better than to post code when I'm in a hurry, but ...
> The above is a bit too simple. Something like
> def process(mlist, msg, msgdata):
>     if mlist.umbrella_list:
>         del msg['x-no-archive']
>         msg['X-No-Archive'] = 'Yes'
> is probably better to avoid creating multiple X-No-Archive: headers.
> Also, if you insert the handler prior to 'ToArchive', the message (any
> message to an umbrella list) will not be archived at all. If you
> insert the handler after 'ToArchive' but prior to 'ToOutgoing', the
> message will be archived in the archive of the first umbrella list it
> hits, but won't be archived in any subsequent lists which is probably
> more like what you want.

This is just what I need, thank you!

However it seems that the "if mlist.umbrella_list:" statement is 
superfluous. On the assumption that the handler is being inserted AFTER 
the first archiving, then surely it's safe to assume that no message 
should be archived a second time and so ALL messages should get an 
X-No-Archive as soon as they've been archived once.

Let me know if I'm off base here.

Kind Regards,


Mike Peachey, IT
Tel: +44 114 281 2655
Fax: +44 114 281 2951
Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK
Comp Reg No: 3191371 - Registered In England

More information about the Mailman-Users mailing list