Re: [exim] condition statement within a router not working a…

Top Page
Delete this message
Reply to this message
Author: Tony Finch
Date:  
To: lists
CC: exim-users
Subject: Re: [exim] condition statement within a router not working as expected
On Fri, 21 Jan 2005 lists@??? wrote:
>
> condition  = "${if and \
>                         { {!eq {$interface_port} {10026} } } \
>                         { { eq {lookup{$local_part@$domain}} lsearch{/etc/exim/exim-relay-domains-aliases} } } \
>                         {yes} {no} \
>               }"


As well as the problem with curlies that Philip mentioned, you are missing
a $. What are you comparing the result of the lookup to?

I like to lay out this kind of thing as follows. The first }} matches the
{${lookup and the second }} matches the and{{.

condition  = ${if and{{ !eq{$interface_port}{10026} } \
                      {  eq{${lookup  {$local_part@$domain} \
                              lsearch {/etc/exim/exim-relay-domains-aliases} }} \
                           {what?!?!} }} \
                  {yes} {no} }


Note that you can also use ${lookup as a conditional, so perhaps you mean:

condition  = ${if !eq{$interface_port}{10026} \
                  {${lookup  {$local_part@$domain} \
                     lsearch {/etc/exim/exim-relay-domains-aliases} \
                             {yes} {no} }} \
                  {no} }


Or you can use match_address:

condition  = ${if and{{ !eq{$interface_port}{10026} } \
                      {  match_address{$local_part@$domain} \
                                      {lsearch;/etc/exim/exim-relay-domains-aliases} }} \
                  {yes} {no} }


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}}