Re: [exim] Spamassassin integration

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Nigel Wade
Date:  
À: exim-users
Sujet: Re: [exim] Spamassassin integration
Sorry, I didn't to include the rules which I use to do the per-user scanning. In
too much of a hurry and pressed send too soon...

This is the router which makes the decision:

driver = accept
no_verify
check_local_user
require_files = $home/.spamassassin/user_prefs
debug_print = running spamtest router for
condition = ${if eq {$received_protocol}{spam-scanned}{no}{yes}}
transport = spamcheck_transport

the above checks for the existence of the users .spamassissin/user_prefs (only
if the protocol isn't spam-scanned, this is important to avoid loops) and is
never run when verifying recipients.

The accompanying transport is:

spamcheck_transport:
     driver = pipe
     use_bsmtp
     headers_remove = 
X-Spam-Score:X-Spam-Status:X-Spam-Flag:X-Spam-Checker-Version:X-Spam-Report:X-Spam-Level:
     command = /usr/sbin/exim -oMr spam-scanned -bS
     transport_filter = /usr/bin/spamc -f -s 5000000 -u $local_part
     user = mail
     log_output = true
     return_fail_output = true
     return_path_add = false
     message_prefix =
     message_suffix =


In order to set the message protocol to spam-scanned, the transport cannot be
run as the recipient, here I use mail. This also has the added caveat that the
users .spamassassin/user_prefs file *must* be readable by that user, here I set
them to be readable by group mail. I also strip any existing SA headers to avoid
confusion. I can't remember why I have the message_prefix and message_suffix set...

-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@???
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555