[Mailman-Users] Filtering with procmail.

Mark Sapiro msapiro at value.net
Thu May 26 06:29:56 CEST 2005

Niels Richter wrote:
>I'm running a mailman-installation at a seperat server. It only gets
>the mails, an spread them to the users. The SPAM-filtering is running
>at another machine but also the SPAM-marked mails are send to the
>So my problem is to get procmail in contact with the incoming mails to
>filter this mails.

The way we do it is we don't use MTA aliases for mailman at all. We
tell the MTA to send all mail for the domain to procmail. Then, rules
in .procmailrc use envelope to in order to decide to what address to
forward the mail or in what mailbox to store the mail or if it's a
mailman list, the command to pipe it to mailman. Here's an excerpt
from .procmailrc

EnvelopeTo = $1

* EnvelopeTo ?? ^mailman$
|sudo -u mailman /var/mailman/mail/mailman post mailman
* EnvelopeTo ?? ^mailman-admin$
|sudo -u mailman /var/mailman/mail/mailman admin mailman
* EnvelopeTo ?? ^mailman-bounces$
|sudo -u mailman /var/mailman/mail/mailman bounces mailman
* EnvelopeTo ?? ^mailman-confirm$
|sudo -u mailman /var/mailman/mail/mailman confirm mailman
* EnvelopeTo ?? ^mailman-join$
|sudo -u mailman /var/mailman/mail/mailman join mailman
* EnvelopeTo ?? ^mailman-leave$
|sudo -u mailman /var/mailman/mail/mailman leave mailman
* EnvelopeTo ?? ^mailman-owner$
|sudo -u mailman /var/mailman/mail/mailman owner mailman
* EnvelopeTo ?? ^mailman-request$
|sudo -u mailman /var/mailman/mail/mailman request mailman
* EnvelopeTo ?? ^mailman-subscribe$
|sudo -u mailman /var/mailman/mail/mailman subscribe mailman
* EnvelopeTo ?? ^mailman-unsubscribe$
|sudo -u mailman /var/mailman/mail/mailman unsubscribe mailman

>My question is: does someone have a solution for this problem or is
>there a better method to filter already marked SPAM-Mails?

Another way is to use header_filter_rules (in Privacy options...->Spam
filters) to recognize your spam markings and discard the spam, but the
earlier in the process that you can dump it, the better.

Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list