
I've done no programming with Mailman. I have a question whose answer is, I suspect, uncontroversial and well-known. I don't know it, though, and don't find it in very quick sweeps through the archives or documents. I'd be happy to have someone just tell me it's already been done, and point me to a reference.
The question is this: what's a good place to intercept postings? I want to feed all Mailman traffic--that is, all postings to any of the Mailman-managed lists on my host, but not administrative requests--through an external process (while still having all the usual e-mail deliveries, archiving, ... proceed as always). Where can I best do this? There are lots of choices; I could slide into the "/usr/local/mailman/mail/wrapper post ..." branch, or several places deeper. By "good", I think what I most want is a place that's very loosely coupled with Mailman. Ideally, I could overlay a new release of Mailman, and keep all my functionality either with no change, or a one-liner.

The question is this: what's a good place to intercept postings? I want to feed all Mailman traffic--that is, all postings to any of the Mailman-managed lists on my host, but not administrative requests--through an external process (while still having all the usual e-mail deliveries, archiving, ... proceed as always). Where can I best do this? There are lots of choices; I could slide into the "/usr/local/mailman/mail/wrapper post ..." branch, or several places deeper. By "good", I think what I most want is a place that's very loosely coupled with Mailman. Ideally, I could overlay a new release of Mailman, and keep all my functionality either with no change, or a one-liner.
I do it by wrapping the aliases with procmail. See
http://www.python.org/pipermail/mailman-users/1999-February/000617.html
for an example, or
http://www.xray.mpe.mpg.de/mailing-lists/procmail/1999-03/msg00063.html
for a slightly more detailed one. This gives me *a lot* more flexibility, including stopping attachments, catching duplicates sent to the list, extended spam filtering, adding X-ListInfo headers, etc...
Chris

Cameron,
Other people have given you good ideas for hooking in outside of Mailman. Mailman has a rudimentary way of calling out to a custom filter script. If you set mm_cfg.DEFAULT_FILTER_PROG, then scripts/post looks for a file by that name in $mailman/filters. If it finds this script, it execfile()'s it and then looks for the processed text in a global attribute called `mailman_text', or it reads stdin for the text.
To be honest, I've never tested this particular feature, and I'm not aware of anybody actually using it. Some sort of filter pipeline would probably be useful for a future version.
-Barry
participants (3)
-
Barry A. Warsaw
-
Cameron Laird
-
Christopher Lindsey