8.1 Spam-Checking via procmail

‚  < ‚  Day Day Up ‚  > ‚  

One easy way to add SpamAssassin to an Exim system is to configure Exim to use procmail as its local delivery agent. Then add a procmail recipe for spam-tagging to /etc/procmailrc .

The advantages of this approach are

  • It's very easy to set up.

  • You can run spamd , and the procmail recipe can use spamc for faster spam-checking.

  • User preference files, autowhitelists, and Bayesian databases can be used.

However, Exim runs a local delivery agent only for email destined for a local recipient. You cannot create a spam-checking gateway with this approach.

To configure Exim to use procmail for local delivery, add the following transport to the Exim configuration file (in the transports section):

 procmail_pipe:     driver = pipe     command =   /usr/local/bin/procmail   -d $local_part     return_path_add     delivery_date_add     envelope_to_add     check_string = "From "     escape_string = ">From "     user = $local_part     group =   mail   

Ensure that you provide the proper path to procmail and an appropriate group for running procmail in the definition of the procmail_pipe transport.

Next add a new router to direct messages to the procmail_pipe transport. This router should be added to the routers section of the configuration file before (or in place of) the localuser router, which is usually the last router.

 procmail:     driver = accept     check_local_user     transport = procmail_pipe     cannot_route_message = Unknown user     no_verify     no_expn 

Local addresses that reach the procmail router will be accepted and delivered via the procmail_pipe transport, which invokes procmail in its role as a local delivery agent.

After any change to the Exim configuration file, you must send a SIGHUP signal to the Exim daemon to cause it to reread the configuration file. You can test configuration changes before you do this by running exim -bV .


Next, configure procmail to invoke SpamAssassin. If you want to invoke SpamAssassin on behalf of every user, do so by editing the /etc/procmailrc file. Example 8-1 shows an /etc/procmailrc that invokes SpamAssassin.

Example 8-1. A complete /etc/procmailrc
 DROPPRIVS=yes PATH=/bin:/usr/bin:/usr/local/bin SHELL=/bin/sh # Spamassassin :0fw * <300000 /usr/bin/spamassassin 

If you run spamd , replace the call to spamassassin in procmailrc with a call to spamc instead. Using spamc/spamd significantly improves performance on most systems but makes it more difficult to enable users to write their own rules.

‚  < ‚  Day Day Up ‚  > ‚  


SpamAssassin
SpamAssassin
ISBN: 0596007078
EAN: 2147483647
Year: 2004
Pages: 88

Similar book on Amazon

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