Re: [EXIM] help with 'and' in condition

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: James FitzGibbon
Dátum:  
Címzett: Philip Hazel
CC: exim-users
Tárgy: Re: [EXIM] help with 'and' in condition
On Thu, 11 Feb 1999, Philip Hazel wrote:

> > ${if and{
> >    {match{$local_part}{^\\d+\$}}
> >    {def:${lookup ldapauth {$local_part:control} {$value} fail}}
> > } {1} {0} }

> >
> > But in both test_expand and verification through exim, I get the message
> >
> > Failed: unknown variable:


> Oh. Wait a minute. What's that def: doing there? def: must be followed
> by a variable name. *That's* the empty variable it is complaining about.
> I should improve the error message. (Makes note.)
>
> You need to use ${if eq{something}{}{...}{...}} to test for an empty
> string.


Ah. The docs for "def" say "This condition is true if the named expansion
variable does not contain the empty string". You might want to clarify
that. I'll give eq a try.

I finally got it to work with this construct:

condition = "${if and {\
              {match {$local_part}{^\\\\d+\\$}}\
              {!eq {${lookup ldapauth {$local_part:control} {$value}}}{}}\
              } {1} {0}}"


I think that besides the def problem, the extra escaping of the
backslashes and dollar sign in the regex were giving me problems.

Thanks.

--
j.

James FitzGibbon                                                james@???
System Engineer, ACC Global Net                   Voice/Fax (416)207-7171/7610



--
*** Exim information can be found at http://www.exim.org/ ***