Ok. Got a basic configuration running using the following routers and
transports. Thanks for the replies.
I an attempt to improve on it a bit I would like to bypass the
spamcheck_router if the sender's host address is part of our B-class
network or the sender's e-mail address is local.
Is it possible to use local_domains and relay_hosts in a condition
statement? Kind of like how they are used in ACLs? For example I am
trying to use something like this:
{!eq {$sender_host_address} {relay_hosts}}
spamcheck_router:
no_verify
# When to scan a message :
# - it isn't already flagged as spam
# - it isn't already scanned
# - user wants spam deletion
condition = "${if and { {!def:h_X-Spam-Flag:} \
{!eq {$received_protocol}{spam-scanned}} \
{eq {1}{${lookup mysql {select spamassasin from user where
userid='${lc:$local_part}'}}}}\
} {1}{0}}"
driver = accept
transport = spamcheck_transport
spamdelete_router:
condition = "${if and { {def:h_X-Spam-Flag:} {eq
{$received_protocol}{spam-scanned}} } {1}{0}}"
driver = accept
transport = spamdelete_transport
spamcheck:
driver = pipe
command = /usr/local/exim-test/bin/exim -oMr spam-scanned -bS
use_bsmtp = true
transport_filter = /usr/bin/spamc
home_directory = "/tmp"
current_directory = "/tmp"
# must use a privileged user to set $received_protocol on the way
back in!
user = mail
group = mail
log_output = true
return_fail_output = true
return_path_add = false
message_prefix =
message_suffix =
spamdelete_transport:
driver = appendfile
file = /dev/null