Re: [Exim] condition statement; using if and and if or ?

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Nico Erfurth
Fecha:  
A: Will Prater - quattro
Cc: exim-users@exim.org
Asunto: Re: [Exim] condition statement; using if and and if or ?
On Fri, 29 Nov 2002, Will Prater - quattro wrote:

> List,
>
> I am using this condition to check a few things for a vacation message
> in mySQL. I cant quite get it to check both statements in the {if and}.
> I have got it to just check for the mysql select statement just fine.
> How does one state it to get both conditions met. Check if the mysql
> SELECT is true and the precedence header is NOT junk|bulk|list OR
> $sender_address does not equal ""?


Please check the documentation, how ${if and ....} works.

> ----
> condition = ${if and { lookup mysql{MYSQL_VAC_ON}{$value}fail} }{ if or
> {{!match {$h_precedence:} {(?i)junk|bulk|list}} {!eq {$sender_address}
> {}}} {yes}{no} } {yes}{no}}


condition = ${if and
               {
                 {or
                   {
                     {eq {$sender_address} {}}
                     {match {$h_precedence:} {(?i)junk|bulk|list}}
                   } {no} {yes}
                 }
                 {eq {1} {$lookup mysql {MYSQL_VAC_ON}{$value}}}
               } {yes}{no}
             }


This is untested, it misses the \ at the linebreaks and most probably does
not the things you wanted it to do, but it should show you how these
constructions works.

And you should check for the fast to evalute things first, because exim
will skip the other test, if the result is already found.

ciao