AW: Re: [exim] Exim: smart_route / routing based on From:

Top Page
Delete this message
Reply to this message
Author: ml
Date:  
To: exim-users
Subject: AW: Re: [exim] Exim: smart_route / routing based on From:
Hi Phil,

thank you !

My config now looks like:

[...]
domainlist local_domains = @
domainlist relay_to_domains =
hostlist relay_from_hosts = 127.0.0.1
addresslist senders_to_xyz = user1@xyz : user2@xyz
...
smart_route_xyz:
condition = ${if match_address{${address:$h_from}}{+senders_to_xyz} {yes}{no}}
driver = manualroute
transport = remote_smtp
route_list = "* mailserverA"


smart_route:
driver = manualroute
domains = ! +local_domains
transport = remote_smtp
route_list = "* mailserverB"
...
[...]

Exim does send Mails but the smart_route´s do not work; instead I see the following exim´s Logfile:

2006-02-24 08:13:51 1FCX9D-0004nP-9U <= foo@baa U=ops P=local S=359
2006-02-24 08:13:51 1FCX9D-0004nP-9U failed to expand condition "${if match_address{${address:$h_from}}{+senders_to_xyz} {yes}{no}}" for smart_route_xyz router: missing 2nd string in {} after "match_address"
2006-02-24 08:13:51 1FCX9D-0004nP-9U => user1@xyz R=smart_route T=remote_smtp H=mailserverB
2006-02-24 08:13:51 1FCX9D-0004nP-9U Completed

Any ideas ?

thanks again !

Kind regards
Sascha




>On 2006-02-23 at 13:42 +0100, ml@??? wrote:
>> smart_route:
>> driver = manualroute
>> domains = ! +local_domains
>> transport = remote_smtp
>> route_list = "* serverabc"
>>
>> which works pretty good, but now i want one exception from this rule:
>> If "From:" of the Mail (not neccessarily the Sender:) is foo@baa mails
>should be send
>> through serverxyz.
>>
>> is this possibile ?
>
>Yes, use a different Router which uses a condition rule to match on
>$h_from; put this first. You can then simplify the smarthost router.
>
>If you want to keep it all in one Router, then you can use route_data
>instead of route_list and then embed the condition inside the string.
>Whilst more concise, that's more confusing for a simple "if this one
>address"; it does start to make sense if you want to use many different
>servers for different users, or at least write it that way. For that
>last case, you can then put the "user: server" stuff in a lookup file
>and use:
>
> route_data = "* ${lookup {${address:$h_from}} lsearch{/file/name}
>{$value}{serverabc}}"
>
>For the simple case of one user to one server, put a copy of the
>smart_route Router above that one, with a different name and smarthost,
>and insert:
>
> condition = ${if match_address{${address:$h_from}}{+senders_to_serverxyz}
>{yes}{no}}
>
>This requires the addresslist +senders_to_serverxyz simply because I
>think it's more maintainable to move that logic out to the start of the
>file in the main config section with:
>
> addresslist senders_to_serverxyz = foo@bar : baz@bat
>
>Regards,
>--
>I am keeping international relations on a peaceable footing.
>You are biding your time before acting.
>He is coddling tyrants.
> -- Roger BW on topic of verb conjugation