Re: [Exim] Condition with and

Top Pagina
Delete this message
Reply to this message
Auteur: Matt Bernstein
Datum:  
Aan: Jan Suchanek
CC: exim-users, km
Onderwerp: Re: [Exim] Condition with and
At 09:26 +0200 Jan Suchanek wrote:

> > condition = ${if and { \
> >    {!eq {${lookup pgsql{SQL_REJECT_LIST}}} {${lc:$sender_address}} } \
> >    { eq {${lookup pgsql{IS_A_LIST}}} {${lc_$local_part}} } \
> >                     } {true}{false}}

>
>this is exactly what I needed. This condition works now. But the one


It is quite inefficient to do the second lookup if the first had failed.
You can do short-circuit and & or using this kind of (untested) trick:

and:    ${if <cond1> {${if <cond2>{1}{0}} {0}}
or:    ${if <cond1> {1} {${if <cond2>{1}{0}}}


It looks a little less pretty, but saves you some computation.

Matt