[Mailman-Developers] Porting "NetiquetteEnforcer" to mailman
Barry A. Warsaw
Fri, 11 May 2001 16:49:47 -0400
>>>>> "LM" == Lars Marowsky-Bree <email@example.com> writes:
LM> I have switched my mailing lists from ezmlm to mailman (mostly
LM> because I wanted to use postfix) a few months ago. Under
LM> ezmlm, I wrote a cute little script called
LM> "NetiquetteEnforcer.pl", which did a rather good job at
LM> rejecting "annoying" (incorrectly formatted etc) mails.
| (If you are interested, you can look at
| http://lars.marowsky-bree.de/dl/NetiquetteEnforcer.pl )
LM> Now, I meant to port this ages ago, but you know how "I will
LM> do it in my copious spare time" works out in practice...
LM> I am looking at how to integrate this properly with
LM> mailman. What I would probably have to do is to hook in
LM> HandlerAPI much like the "Hold" Handler and either hold the
LM> message, reject it immediately or let it pass through.
LM> However, I am unclear about how to do get the configuration
LM> information done properly - I would rather like an additional
LM> screen for the Content Filtering scheme in the Web management
LM> tools, and it isn't immediately obvious to me how I would go
LM> about this.
LM> Any insight would be appreciated.
Adding a new admin screen is actually pretty easy. I think a good
(modern) example is GatewayManager.py or Autoresponder.py.
Essentially you are going to write a mixin class that will be added to
the base classes for MailList. Your mixin should include a
GetConfigInfo() method which contains all the specifications for the
gui widgets on your admin screen. You might also need an InitVars()
Where the black magic comes in: if you're adding new attributes to the
MailList object, you should add code to versions.py so that existing
list schemas will be automatically updated when the list is loaded.
You also need to do a moderate bit of glue work in the MailList class
and in the admin.py script.
Adding NetiquetteEnforcer as another hold should be much simpler, and
I still have it on my todo list for 2.1 to improve the configurability
of the holds (so some matches can automatically discard or reject,