Re: [Exim] Q: Smarthost and two smtp-hosts by IP?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Jari M M Lammi
CC: exim-users
Subject: Re: [Exim] Q: Smarthost and two smtp-hosts by IP?
On Thu, 14 Jun 2001, Jari M M Lammi wrote:

>     route_list = "* \"${if match{$header_to:}{\\.ampr.org\\$} \
>                          {oh2rbi-1.ampr.org}{smtp.helsinki.fi}}\" bydns_a"


This is a quoting problem. The regex you want to run is

\.ampr\.org$

But the arguments for ${if get expanded, so it changes to

\\.ampr\\.org\$

And you have chosen to put it all in double quotes, so you have to write

\\\\.ampr\\\\.org\\$

I would recommend not using the double quotes!

However, in this case, it doesn't actually explain your problem, because
the regex that finally gets obeyed is .ampr.org$ which should still
match. Question: Why are you looking at $header_to: and not $domain? The
text of $header_to: may contain all sorts of stuff. It may not be

To: user@???

It might be

To: some body <user@???>

in which case it won't match. You should be using $domain instead.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.