Re: [Exim] Use of "condition"

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Philip Hazel
Date:  
À: Jan Suchanek
CC: exim-users
Sujet: Re: [Exim] Use of "condition"
On Mon, 27 Aug 2001, Jan Suchanek wrote:

>    condition = { if or {${lookup pgsql{select username from
> domain_reject where lower(username)=lower('$local_part') and
> lower(reject)=lower('$sender_address_domain')}{yes}{no}}} {${lookup
> pgsql{select username from reject where
> lower(username)=lower('$local_part') and
> lower(reject)=lower('$sender_address')}{yes}{no}}} {{no}{yes}}}


The start of this condition ("{ if ") is not an expansion action. It
should be "${if". If you do that, you'll get a syntax error, because the
sub-conditions inside your "or" are not valid subconditions. If you want
to do it this way, you have to write

  condition = ${if or                     \
               {                          \
               {eq {${lookup....}}{yes}}  \
               {eq {${lookup....}}{yes}}  \
               }                          \
               {yes}{no}}


But you don't need to do this. You could also do

  condition = ${lookup ... {yes}          \
               {                          \
               ${lookup ... {yes}{no}}    \
               }}


In other words, put the second lookup in the "fail" argument of the
first lookup.


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.