[Mailman-Users] Revisit to moderator aliases

Mark Sapiro mark at msapiro.net
Sat Nov 21 06:40:38 CET 2009


Bill Catambay wrote:

>At 7:48 PM -0800 on 11/17/09, Mark Sapiro wrote:
>
>So I need to ask them to install a custom handler for the foo-list 
>(my) mailing list (and God willing, they'll understand what that 
>means).  I'll tell them to change:
>
>def process(mlist, msg, msgdata):
>     if msgdata.get('approved') or msgdata.get('fromusenet'):
>         return
>     # First of all, is the poster a member or not?
>     for sender in msg.get_senders():
>         if mlist.isMember(sender):
>             break
>     else:
>         sender = None
>
>to:
>
>def process(mlist, msg, msgdata):
>     if msgdata.get('approved') or msgdata.get('fromusenet'):
>         return
>     # First of all, is the poster a member or not?
>     for sender in msg.get_senders(headers=(None,)):
>         if mlist.isMember(sender):
>             break
>     else:
>         sender = None
>
>(i think just checking envelope sender is all I need since I'm the 
>only one who will know about this email)(well, me and everyone on 
>this mailing list ;))
>
>I hope someone there knows how to do this, otherwise this has all been in vain.


They need to do the following:

1. Copy Mailman/Handlers/Moderate.py to Mailman/Handlers/Moderate_foo.py

2. Edit Moderate_foo.py as above

3. This step can be done in multiple ways, but perhaps the easiest to
explain is as follows:

  Create the file extend.py in the lists/foo-list/ directory (the
already existing directory that contains the foo-list config.pck,
etc.) The contents of this file are the 5 lines:

import copy
from Mailman import mm_cfg
def extend(mlist):
    mlist.pipeline = copy.copy(mm_cfg.GLOBAL_PIPELINE)
    mlist.pipeline[mlist.pipeline.index('Moderate')] = 'Moderate_foo'


See the FAQ at <http://wiki.list.org/x/l4A9> for more detail.

-- 
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