4.15. How do I filter incoming mail before it hits mailman (e.g., using procmail)
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
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:
If you use smrsh you'll have to put a link to procmail in to /etc/smrsh for this to work, e.g.
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:
before the lines above.
Last changed on Mon Nov 15 06:10:57 2004 by Peter McNeil
Converted from the Mailman FAQ Wizard
This is one of many Frequently Asked Questions.