Re: [Exim] Condition with and

Top Page
Delete this message
Reply to this message
Author: Jan Suchanek
Date:  
To: Matt Bernstein
CC: exim-users, km
Subject: Re: [Exim] Condition with and
This is a cryptographically signed message in MIME format.
--
Hi,

Matt Bernstein wrote:
> 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.


thank you for your tip. I will try this occasionally, but at this time I
am just happy that it works - I dont think the mailserver will get too
much load - but I keep this performance tip in mind.

>
> Matt
>
>
>


Greetings, Jan Suchanek


--
Jan Suchanek,
Universitaet Ulm,
Abteilung Medieninformatik,
Fakultaet fuer Informatik,

89069 Ulm, Germany
Raum: O27/3302

Tel.: +49/(0)731-5031312, Fax: +49/(0)731-5031302

--
Content-Description: S/MIME Cryptographic Signature

[ smime.p7s of type application/x-pkcs7-signature deleted ]
--