[Exim] Re: Multi level if-and statements

Top Page
Delete this message
Reply to this message
Author: support
Date:  
To: exim-users
CC: 
Subject: [Exim] Re: Multi level if-and statements

List,

Since there has been no response, is this currently possible in exim 4 (im using
4.20)?  I'm not looking for someone to solve my problem, just looking for an
example of a condition statement with 3 conditions (currently 2 works fine, but I
have yet to figure out 3).

Thanks,

Matt

---- Original Message ----
From:        support@???
Date:        Wed 6/25/03 13:51
To:        exim-users@???
Subject:    Multi level if-and statements

Im attempting to make a 2 condition if statement into a 3 condition if statemnt...

I started with:
condition = ${if and {{!def:header_X-GForce-Host-Number:}{!eq {$localhost_number}
{2}}} {yes}{no}}

Which works, but I need to add another condition to verify that the user is a local
user.  I ended up with:
condition = ${if and {\
        {${if and {{!def:header_X-GForce-Host-Number:}{!eq
{$localhost_number}{3}}} {yes}{no}}}\
        {${lookup mysql{\
                    SELECT REPLACE(accounts.account, '@', '\\\\@') as
account \
                    FROM email.accounts, email.aliases, bind.zones \
                    WHERE accounts.account_id=aliases.account_id \
                            AND zones.zone_id=aliases.zone_id \
                            AND zones.zone='${quote_mysql:$domain}' \
                            AND
aliases.alias='${quote_mysql:$local_part}' \
                            AND aliases.account_id > 0 \
                        AND aliases.remote_addr = '' \
              }}\
        }\
} {yes}{no}}

Which doesnt work, an exim -bt to a local account comes out with:
LOG: MAIN PANIC
  failed to expand condition "${if and {{${if and {{!def:header_X-GForce-Host-
Number:}{!eq {$localhost_number}{3}}} {yes}{no}}}{${lookup mysql{SELECT REPLACE
(accounts.account, '@', '\\\\@') as account FROM email.accounts, email.aliases,
bind.zones WHERE accounts.account_id=aliases.account_id AND
zones.zone_id=aliases.zone_id AND zones.zone='${quote_mysql:$domain}' AND
aliases.alias='${quote_mysql:$local_part}' AND aliases.account_id > 0 AND
aliases.remote_addr = '' }}}} {yes}{no}}" for mail01 router: condition name
expected, but found "${if and {{!def:"

Any suggestions would be appreciated :)

Thanks,

Matt