[Mailman-Users] Topics and friendly rejections of topicless messages

Stephen J. Turnbull stephen at xemacs.org
Sat Apr 2 19:33:32 CEST 2011

Patti Beadles writes:

 > Item D is throwing me for a loop.  I can make it happen with a
 > one-line change to SpamDetect.py, but that's probably not going
 > to fly.  The host runs multiple lists, and doing this would 
 > constrain the other lists in ways that aren't really acceptable.

I do this kind of thing in several Handlers.  There are two ways to
approach this.  The easy way is that the Handler knows what list it is
processing (the mlist argument to process()):

    if mlist.internal_name() in my_lists:
        # do my thing

The more elegant way (and not much harder) is to define a
MyVeryOwnSpamDetect handler (which starts as a copy of
SpamDetect.py!), save it to the Handlers directory, then insert it in
the list's configuration with

$ cd /path/to/mailman/lib; bin/withlist -l mylist
> mlist.pipeline = GLOBAL_PIPELINE
> mlist.pipeline[position_of_SpamDetect] = 'MyVeryOwnSpamDetect'
> mlist.Save()
> <Ctrl-D>

And now you know why all the cool kids love Mailman!

More information about the Mailman-Users mailing list