Re: [Exim] condition/lookup assistance needed

Pàgina inicial
Delete this message
Reply to this message
Autor: Odhiambo Washington
Data:  
A: Fernando Durango
CC: exim-users
Assumpte: Re: [Exim] condition/lookup assistance needed
* Fernando Durango <fernando@???> [20040520 01:24]: wrote:
> 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}}



Here is how your condition should have been written, I believe..

condition = ${if and { \
                     {def:header_X-VIRUSMATCH}{YES} } \
                     {eq {PREFS_VIRUS}{devnull} }
                     } \
                     {yes}{no} \
                     }



..and here is how you MUST test your conditions on the command line..

exim -be '${if and {{def:header_X-VIRUSMATCH}{YES}}{eq {PREFS_VIRUS}{devnull}}}{yes}{no}}'



HTH


-Wash

http://www.netmeister.org/news/learn2quote.html

--
+======================================================================+
    |\      _,,,---,,_     | Odhiambo Washington    <wash@???>
Zzz /,`.-'`'    -.  ;-;;,_ | Wananchi Online Ltd.   www.wananchi.com
   |,4-  ) )-,_. ,\ (  `'-'| Tel: +254 20 313985-9  +254 20 313922
  '---''(_/--'  `-'\_)     | GSM: +254 722 743223   +254 733 744121
+======================================================================+
Always borrow money from a pessimist; he doesn't expect to be paid
back.