Re: [exim] missing } in condition

Top Page
Delete this message
Reply to this message
Author: Tony Finch
Date:  
To: Pawel Rutkowski
CC: exim-users
Subject: Re: [exim] missing } in condition
On Sat, 9 Aug 2008, Pawel Rutkowski wrote:

>         Anyone know why this condition:

>
> condition = ${if and {\
>         {eq
> {${lookup{$sender_address_domain}lsearch{/etc/exim/ze_skrzynkami}{0}{1}}}{1}{0}{1}}\
>         {eq
> {${lookup{$sender_address_domain}lsearch{/etc/exim/ze_skrzynkami}{0}{1}}}{1}{0}{1}}\
>         }{1}{0}}

>
> give this error:
> "missing } at end of condition inside "and" group"


Better formatting is the answer to questions like this.

 condition = \
   ${if and{{ eq{${lookup {$sender_address_domain} \
                   lsearch {/etc/exim/ze_skrzynkami} \
                   {0} {1} }} \
                {1} \
# here you have {0}{1} which makes no sense
# since eq{}{} takes only two parameters
           }{ eq{${lookup {$sender_address_domain} \
                   lsearch {/etc/exim/ze_skrzynkami} \
                   {0} {1} }} \
                {1} \
# here you have another spurious {0}{1}
           }} \
        {1} {0} }


You're testing the same lookup twice, so this is equivalent to:

  ${lookup {$sender_address_domain} \
    lsearch {/etc/exim/ze_skrzynkami} \
     {0} {1} }


Tony.
--
<fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}