9.6 Delivery Time Filtering Rules

The most practical way to do delivery time filtering is to call filter programs from procmail or maildrop. (All these examples use procmail, but you can do the same things from maildrop.) Procmail is called in the context of the delivery user, so it's straightforward to use the user's personal preferences for filtering. These procmail rules, for example, call DCC and Spamassassin, both of which add X- message headers to the mail to report what they found. Tagged mail is filed in a separate mailbox, in this case a spam subfolder of Maildir where it's visible as a subfolder in Courier IMAP. The procmail rules can either go in /usr/local/etc/procmailrc, the global file used by default, or go in an individual user's procmailrc for users who want to fiddle with their own rules (see Example 9-9).

Example 9-9. Filtering in procmail
# filter through dcc using the user's whitelist :0 f | dccproc -cCMN,40 -ERw .dcc/whiteclnt :0 * X-DCC-IECC-Metrics: .*bulk {          LOG="Reject: tagged by DCC "         :0         ./Maildir/.spam/ } # filter through spamassassin for messages under 300K :0 fw * < 300000 | spamassassin :0 * X-Spam-Status: Yes {          LOG="Reject: tagged by spamassassin "         :0         ./Maildir/.spam/ }


qmail
qmail
ISBN: 1565926285
EAN: 2147483647
Year: 2006
Pages: 152

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net