[Exim] condition/lookup assistance needed

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Fernando Durango
Datum:  
To: exim-users
Betreff: [Exim] condition/lookup assistance needed
Hello All,

For the life of me, I cannot figure out what is wrong with
my condition statement. Can anyone help?

I am attempting to run a router if two conditions are true via an
"${if and{{eq...}{eq...}}}" expansion. Config is as follows:

# Macros
PREFS_VIRUS = \
    ${lookup mysql \
      {SELECT virus FROM prefs \
       WHERE domainname = lower('${quote_mysql:$domain}');} \
      {$value}{f}}


# ACLs
check_data:
  warn  message = X-VIRUSMATCH: YES
        malware = *


# Routers
devnull_virus:
  driver        = redirect
  data          = :blackhole:
  condition     = ${if and {{eq{$h_X-VIRUSMATCH}{YES}}\
                     {eq{PREFS_VIRUS}{devnull}}}{yes}{no}}


In the logs, I get messages like:
failed to expand condition "${if and
{{eq{$h_X-VIRUSMATCH}{YES}}{eq{${lookup mysql {SELECT virus
FROM prefs WHERE domainname = lower('${quote_mysql:$domain}');}
{$value}{f}}}{devnull}}}{yes}{no}}" for devnull_virus router: missing } at
end of condition inside "and" group

I have tried adding }'s to the few places that seem logical, but to no
effect. I have also tried adding indentation to try to spot nesting
errors, still no luck. I must be really blind to my error. Any assistance
would be greatly appreciated!

    -F