[Mailman-Users] Using procmail with mailman

Paul Tomblin ptomblin at xcski.com
Tue Dec 11 13:56:04 CET 2001


I was all set to write up a faq entry for using procmail to filter mail
before it hits mailman, but after I typed it in it asked for a password
which I don't know.

If somebody thinks the following has merit, please add it to the FAQ for
me:

Title: How do I filter incoming mail before it hits mailman

I spam filter incoming mail on my public lists using procmail.  It
doesn't require changing either procmail or Mailman.  What I did was
put my procmail filter in /etc/procmailrcs/mailman (your procmail may
want it somewhere else) and change the ownership so that it belongs to 
the group that I configured mailman's "--with-mail-gid=", in my case
nobody.nobody.

I replaced the mail list alias, from
    lugor-announce:          "|/usr/home/mailman/mail/wrapper post lugor-announce
to
    lugor-announce:          "|/usr/bin/procmail -m MAILMAN=lugor-announce /etc/procmailrcs/mailman

The procmail filter I use stores spam in a folder for review in mailman's
Mail directory, but they belong to "nobody", not "mailman", which can be a
minor problem at times.  The last lines of the procmail filter pass the
mail (if it wasn't filed as spam) to mailman with the commands:
    :0
    |/usr/home/mailman/mail/wrapper post ${MAILMAN}

Because I used to use an older version of Mailman that mistook the
"Sender:" header for the envelope sender (somebody misread RFC 822!), I
also used that procmail filter to strip out the Sender header, using the
lines:
    :0 f
    | formail -R "Sender:" "X-Former-Sender:"
before the lines above.

-- 
Paul Tomblin <ptomblin at xcski.com>, not speaking for anybody
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid.  Get yourself a better computer" - Dilbert.




More information about the Mailman-Users mailing list