Exim and Virtual Users with DSPAM
After installing virtual exim (http://silverwraith.com/vexim/) and following the directions for installing dspam with exim (http://dspam.nuclearelephant.com/dspam-users/2992.html), I wanted to configure exim to only run the dspam router on accounts that have asked for it. Virtual Exim is set up for SA, and on installation I'd already commented out that, the blacklist checks, and the clamav check, so I more or less copied the relevant clauses for checking the vexim DB's spamassassin enabled flag into dspam, and then went and replaced all references to SA into dspam in the UI (and changed the irrelevant fields like threshold into hidden fields - didn't delete them in case VExim won't run without them). The DB and app still internally use the terms 'spamassassin', but that doesn't really matter, does it? When I have time, I may just write a patch for DSpam support in Virtual Exim, but more likely I'll just be glad it's all over.
Here's the dspam router - originally sourced from the exim + dspam howto, modified for newer versions of dspam, then modified further to check the vexim SA enabled flag:
dspam_router:
no_verify
condition = ${if and { {!def:h_X-FILTER-DSPAM:} \
{!eq {$received_protocol}{local}} \
{!eq {$sender_address_domain}{$domain}} \
{eq {${lookup mysql{select users.on_spamassassin from users,domains \
where localpart = '${quote_mysql:$local_part}' \
and domain = '${quote_mysql:$domain}' \
and users.on_spamassassin = '1' \
and users.domain_id = domains.domain_id} } }
{1} } }
{1}{0}}
driver = accept
transport = dspam_spamcheck
