On Wed, Apr 12, 2006, Marten Lehmann wrote:
>> with every recipient, set an acl_c* variable if and only if there is
>> some spamcheck action to be performed. pass the mail to spamd if it's
>> set.
> I'm trying to do this, but I couldn't figure out how to do it yet. This
> is a part of my configure-file (acl_check_rcpt):
> accept domains = +local_domains
> endpass
> verify = recipient
> set acl_c0 = ${if or { \
> {or { \
> {eq{${lookup{$local_part@$domain}lsearch*@{/mailin/conf/antispam.txt}}}{subject-rewrite}}
> \
> {eq{${lookup{$local_part@$domain}lsearch*@{/mailin/conf/antispam.txt}}}{junk-folder}}
> \
> }} \
> {eq{$acl_c0}{yes}} \
> } \
> } {yes}{no}}
try it that way, in check_rcpt:
REWRITE_P=eq{subject-rewrite}{${lookup{$local_part@$domain}lsearch*@{/mailin/conf/antispam.txt}}}
JUNKFOLDER_P=eq{junk-folder}{${lookup{$local_part@$domain}lsearch*@{/mailin/conf/antispam.txt}}}
warn domains = +local_domains
condition = ${if or { {REWRITE_P} {JUNKFOLDER_P} }}
set acl_c0 = 1
accept domains = +local_domains
endpass
verify = recipient
in acl_check_data:
warn condition = $acl_c0
spam = nobody:true/defer_ok
then, in routers/transports, perform actions depending on REWRITE_P and
JUNKFOLDER_P macros.
this way, acl_c0 will be set to 1 if at least one of the recipient
requires spam filtering.
HTH,
-- sh