[exim] match_domain not working in data acl

Top Page
Delete this message
Reply to this message
Author: Thomas Mueller
Date:  
To: exim-users
Subject: [exim] match_domain not working in data acl
Hi,

I'd like to do spam and virus scanning depending on the domain (Exim 4.50).

For this to work I allow only recipients of the same domain in one mail
and keep the domain in acl_m0. This works as expected, RCPT ACL:
  defer
    message   = ...
    condition = ${if and { \
                            {!eq{$acl_m0}{}} \
                            {!eq{$acl_m0}{$domain}} \
                         } {yes}{no}}


  accept
    domains = +relay_to_domains
    set acl_m0 = $domain


In the DATA ACL I'd like to do this:
  accept
    condition = ${if match_domain{$acl_m0}{+relay_to_domains}{yes}{no}}


  deny
    message = This message contains malware ($malware_name)
    demime = *
    malware = *
    logwrite = Virus found: $malware_name (for $acl_m0)


But the condition for the accept is never true, domains in
relay_to_domains get virus scanned too.
The logwrite logs the right domain, relay_to_domains works wherever I
use it as expected. So the pieces are ok but they don't work together
and I have no idea why. What's wrong?


Thanks,
Thomas