Re: [Exim] Boolean evaluation

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Dmitry Shikut
Date:  
À: exim-users, Bernard Stern
Sujet: Re: [Exim] Boolean evaluation
> > ${if
> >

and{{exists{/usr/local/etc/exim/domains/virus22.com/passwd}}{eq{qwerty}{${ex
> >

tract{1}{:}{${lookup{shikut}lsearch{/usr/local/etc/exim/domains/virus22.com/
> > passwd}{$value}{fail}}}}}}}{yes}{no}}
>
> First I don't think you want {fail}, but merely fail. {fail} would in
> fact return the string 'fail', which, if I'm interpreting your stuff
> correctly, is not what you want.

    Have sence... In the 'server_condition' 'fail' is more preffered than
simply '{fail}'...


> The condition is 'file foo must exist AND string bar must match looked up

string'.
> You can rewrite your condition without the AND.
>
> condition = ${if condition {true-replacement} fail}
>
> with
>
> condition = exists {/usr/local/etc/exim/domains/virus22.com/passwd}
> true-replacement =
>   {eq \
>       {qwerty} \
>       { ${extract {1} {:} \

>

{${lookup{shikut}lsearch{/usr/local/etc/exim/domains/virus22.com/passwd}{$va
lue}fail}} \
>          } \
>       } \
>   }

    Thanks... This is another variant of solution...


> Well the exim spec seems to be quite positive about condition B not being
> evaluated if condition A is false (when checking A and B). However, I
> remember having encountered similar problems as you describe, this is
> why you have to write your stuff differently.

    I'm understand.. But structure of the condition will be 'hard'...


    Dmitry Shikut, shikut@???