Contribution: Procmail mail filter format

Hi,
I installed Mailman on my system yesterday--a very nice piece of code!
I have an account on a host which gives me a virtual e-mail address, as in everything that goes to @my.domain.com is forwarded to my account, and I can't just add things to /etc/aliases, or the whole system would go belly up (I don't even have privs to anything in /etc). So what I use to sort through mail is Procmail, which works very nicely. I got Mailman to run in this one-user setup using Procmail quite simply.
What I've done is added some code to bin/newlist which will generate the Procmail filtering rules for me. I'm not sure how to submit my changes, but here they are. I did these changes on a pretty vanilla Mailman-2.0.3 distribution.
First, the definition of the alias style:
PROCMAIL_ALIAS_STYLE = """ :0
- $^To:.*%(listname)s
| %(wrapper)s post %(listname)s
:0
- $^To:.*%(listname)s+(-owner|-admin)
| %(wrapper)s mailowner %(listname)s
:0
- $^To:.*%(listname)s-request
| %(wrapper)s mailcmd %(listname)s """
And now checking the config for the procmail identifier:
elif style == 'procmail': ALIASTEMPLATE = PROCMAIL_ALIAS_STYLE STDOURMSG = 'To create list aliases, add this to your procmailrc:'
All you need to do is set the MTA style to 'procmail' and it will generate the Procmail filter rules. I did all of this with no previous knowledge of Python whatsoever, so there probably are some mistakes, despite the small size of this code...
Thanks for Mailman. Now I'm paying back. ;-)
participants (1)
-
Chris Boot