Re: [Exim] Error in Condition

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Fred Viles
Date:  
À: exim-users
Sujet: Re: [Exim] Error in Condition
On 29 Jun 2004 at 18:20, Jerry wrote about
    "[Exim] Error in Condition":


| I'm rather new here, and not familiar with PERL (I do PHP, C, C++,
| etc.), so this is a very basic question. However, I can't figure out
| for the life of me what I'm doing wrong.

|...
|    condition = ${if and {or {eq {$local_part} {addr1} \
|                             {eq {$local_part} {addr2}} \
|                {eq {$interface_address}{127.0.0.1}}}} {1} {0}}

|...
| 2004-06-29 18:19:19 1BfQwZ-0004nB-0n failed to expand condition "${if
| and {or {eq {$local_part} {addr1} {eq {$local_part} {addr2}} {eq
| {$interface_address}{127.0.0.1}}}} {1} {0}}" for bwlist_router_2 router:
| subcondition in {} expected inside "and{...}" condition


Odd, I'd've expected an error at the "or" because of that's where the
first missing open-brace is.

| Can someone please tell me what this means - and what to do to correct it?


Well, let's see. The syntax for "and" is:

    and {{<cond1>}{<cond2>}...}


and similarly for "or". The keyword is followed by a curly-brace
enclosed set of conditions, each of which is also enclosed in curly-
braces. You're missing a bunch of braces. Extra whitespace can help
visualize where they go. Is this clearer? (Use a fixed pitch font
to see what I'm seeing)

    condition = ${if and { \
        {or { \
        {eq {$local_part} {addr1}} \
                                 {eq {$local_part} {addr2}} \
        } \
                           } \
                           {eq {$interface_address}{127.0.0.1}} \
                         } \
                  {1} {0} }


BTW, what's PERL got to do with it?

- Fred