[exim] problem with ${if } in nested and {} condition

Top Page
Delete this message
Reply to this message
Author: Marten Lehmann
Date:  
To: exim-users
Subject: [exim] problem with ${if } in nested and {} condition
Hi,

I need to build a condition with nested if-s, but I cannot get it work:

   defer   condition     = ${if  and { \
                                         { \
                                                 ${if eq{}{} \
                                                 {true} \
                                                 {false} } \
                                         } \
                                         {eq{}{}} \
                                 } \
                            }


Of course, this condition does not make sense in that stage. But it is a
construct of conditions which I need later with complex ldap lookups.
And the "false" will be replaced by another if-condition.

But even this simple start returns an error:

failed to expand ACL string "${if        and { { ${if eq{}{} {true} 
{false} } } {eq{}{}} } }": condition name expected, but found "${if 
eq{}{} {tru" inside "and{...}" condition


I can _not_ replace

${if eq{}{} {true}{false} }

with

eq{}{}

because later it has to look like this:

${if eq{}{} {true}
{
    ${if eq{}{} {do this}{do that} }
} }


The last example will work fine, but it stops working as soon as I'm
putting it with an and {} group. How can I use nested if-s within and and{}?

Regards
Marten