Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Router/Transport Problem with multiple entries

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


exim at southportcomputers

Oct 22, 2011, 3:08 PM

Post #1 of 7 (638 views)
Permalink
Router/Transport Problem with multiple entries

Hi folks,

I have a niggle. I use the router and transport shown at the bottom.
With this setup I have one case where mail does not get delivered. It
sits in the queue and delivery errors fail with "remote_smtp_smart
transport has empty hosts setting"

Say I have the following in /etc/staticroutes

domain1.com: 1.1.1.1
domain2.com: 2.2.2.2
domain3.com: 1.1.1.1

Delivery to each domain individually is fine. A message addressed to
user [at] domain1 and user [at] domain2 is fine.

A message which contains any user at domain1.com and domain3.com will
fail as both domains point to the same IP address. Can anyone see an
obvious reason why these would fail?

Thanks.

#Router

static_route:
driver = manualroute
transport = remote_smtp_smart
route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}


#Transport

remote_smtp_smart:
driver = smtp
port = 25
delay_after_cutoff = false
hosts = ${lookup{$domain}lsearch{/etc/staticroutes}}
hosts_override


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


dlugo at etherboy

Oct 22, 2011, 4:05 PM

Post #2 of 7 (545 views)
Permalink
Re: Router/Transport Problem with multiple entries [In reply to]

On Sat, 22 Oct 2011, Colin wrote:
>
> Say I have the following in /etc/staticroutes
>
> domain1.com: 1.1.1.1
> domain2.com: 2.2.2.2
> domain3.com: 1.1.1.1
>
> Delivery to each domain individually is fine. A message addressed to
> user [at] domain1 and user [at] domain2 is fine.
>
> A message which contains any user at domain1.com and domain3.com will fail as
> both domains point to the same IP address. Can anyone see an obvious reason
> why these would fail?
>
> Thanks.
>
> #Router
>
> static_route:
> driver = manualroute
> transport = remote_smtp_smart
> route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
>
>

all seems good so far...

> #Transport
>
> remote_smtp_smart:
> driver = smtp
> port = 25
> delay_after_cutoff = false
> hosts = ${lookup{$domain}lsearch{/etc/staticroutes}}
> hosts_override
>

Do you need hosts & hosts_override there? What happens if you
remove them?


--
--------------------------------------------------------
Dave Lugo dlugo [at] etherboy No spam, thanks.
Are you the police? . . . No ma'am, we're sysadmins.
--------------------------------------------------------

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


exim-users at spodhuis

Oct 22, 2011, 6:50 PM

Post #3 of 7 (536 views)
Permalink
Re: Router/Transport Problem with multiple entries [In reply to]

On 2011-10-22 at 23:08 +0100, Colin wrote:
> Say I have the following in /etc/staticroutes
>
> domain1.com: 1.1.1.1
> domain2.com: 2.2.2.2
> domain3.com: 1.1.1.1
>
> Delivery to each domain individually is fine. A message addressed to
> user [at] domain1 and user [at] domain2 is fine.
>
> A message which contains any user at domain1.com and domain3.com will
> fail as both domains point to the same IP address. Can anyone see an
> obvious reason why these would fail?

Yes.

Look up the documentation for "$domain":

When an address is being routed, or delivered on its own, this variable
contains the domain.
[...]
When more than one address is being delivered at once (for example, several
RCPT commands in one SMTP delivery), $domain is set only if they all have
the same domain. Transports can be restricted to handling only one domain
at a time if the value of $domain is required at transport time - this is
the default for local transports. For further details of the environment in
which local transports are run, see chapter 23.

> #Router
>
> static_route:
> driver = manualroute
> transport = remote_smtp_smart
> route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}

So at this point, the transport can access the host via $route_data.

> #Transport
>
> remote_smtp_smart:
> driver = smtp
> port = 25
> delay_after_cutoff = false
> hosts = ${lookup{$domain}lsearch{/etc/staticroutes}}
> hosts_override

And here you look up the hosts again, but $domain will not be set if
multiple domains are being passed down one connection.

The static_route Router has provided a list of hosts via the
"route_data" option -- you don't need to override it again here. Just
leave off the hosts/hosts_override option to use whatever hosts were
passed into this via the Router which specified to use this Transport.

-Phil

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


exim at southportcomputers

Oct 23, 2011, 2:02 AM

Post #4 of 7 (532 views)
Permalink
Re: Router/Transport Problem with multiple entries [In reply to]

On 23/10/2011 00:05, Dave Lugo wrote:
>
> On Sat, 22 Oct 2011, Colin wrote:
>>
>> Say I have the following in /etc/staticroutes
>>
>> domain1.com: 1.1.1.1
>> domain2.com: 2.2.2.2
>> domain3.com: 1.1.1.1
>>
>> Delivery to each domain individually is fine. A message addressed to
>> user [at] domain1 and user [at] domain2 is fine.
>>
>> A message which contains any user at domain1.com and domain3.com will
>> fail as both domains point to the same IP address. Can anyone see an
>> obvious reason why these would fail?
>>
>> Thanks.
>>
>> #Router
>>
>> static_route:
>> driver = manualroute
>> transport = remote_smtp_smart
>> route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
>>
>>
>
> all seems good so far...
>
>> #Transport
>>
>> remote_smtp_smart:
>> driver = smtp
>> port = 25
>> delay_after_cutoff = false
>> hosts = ${lookup{$domain}lsearch{/etc/staticroutes}}
>> hosts_override
>>
>
> Do you need hosts & hosts_override there? What happens if you
> remove them?
>
>
Thank you for the reply, the reason that is in there is because the spec
says this about the hosts line:

"This option is ignored when the address has been routed by a router
that supplies a host list (for example, /lookuphost/), unless
/hosts_override/ is set."

I read this to mean that the hosts line in the transport will be ignored
unless hosts_override is in there - am a I wrong?

Incidentally, I thought of a couple of queries with regards to improving
the "staticroutes" setup as follows:

1) If I was to put multiple entries for a domain in the staticroutes
file, will Exim try each of them in order until one succeeds?

2) The transport specifically uses port 25. I was wondering if this
could be a default setting but over-ridden if the staticroutes file
contained a line such as:

domain.com: 1.1.1.1:26

I've only had to use an alternate port once when someone's broadband was
down. They had a backup freephone dialup but port 25 was blocked on it.
I had to write an entirely separate staticroutes2 to use an alternate
port back then. It would be nice to have an easy option though!

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


exim at southportcomputers

Oct 23, 2011, 2:10 AM

Post #5 of 7 (530 views)
Permalink
Re: Router/Transport Problem with multiple entries [In reply to]

On 23/10/2011 02:50, Phil Pennock wrote:
> On 2011-10-22 at 23:08 +0100, Colin wrote:
>> Say I have the following in /etc/staticroutes
>>
>> domain1.com: 1.1.1.1
>> domain2.com: 2.2.2.2
>> domain3.com: 1.1.1.1
>>
>> Delivery to each domain individually is fine. A message addressed to
>> user [at] domain1 and user [at] domain2 is fine.
>>
>> A message which contains any user at domain1.com and domain3.com will
>> fail as both domains point to the same IP address. Can anyone see an
>> obvious reason why these would fail?
> Yes.
>
> Look up the documentation for "$domain":
>
> When an address is being routed, or delivered on its own, this variable
> contains the domain.
> [...]
> When more than one address is being delivered at once (for example, several
> RCPT commands in one SMTP delivery), $domain is set only if they all have
> the same domain. Transports can be restricted to handling only one domain
> at a time if the value of $domain is required at transport time - this is
> the default for local transports. For further details of the environment in
> which local transports are run, see chapter 23.
>
>> #Router
>>
>> static_route:
>> driver = manualroute
>> transport = remote_smtp_smart
>> route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
> So at this point, the transport can access the host via $route_data.
>
>> #Transport
>>
>> remote_smtp_smart:
>> driver = smtp
>> port = 25
>> delay_after_cutoff = false
>> hosts = ${lookup{$domain}lsearch{/etc/staticroutes}}
>> hosts_override
> And here you look up the hosts again, but $domain will not be set if
> multiple domains are being passed down one connection.
>
> The static_route Router has provided a list of hosts via the
> "route_data" option -- you don't need to override it again here. Just
> leave off the hosts/hosts_override option to use whatever hosts were
> passed into this via the Router which specified to use this Transport.
>
> -Phil
>
Thank you for the good explanation of the setting, I shall do some
testing on it now - or at least when the test server reboots.

Regards,
Colin.

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


dlugo at etherboy

Oct 23, 2011, 6:20 PM

Post #6 of 7 (531 views)
Permalink
Re: Router/Transport Problem with multiple entries [In reply to]

On Sun, 23 Oct 2011, Colin wrote:
>
> "This option is ignored when the address has been routed by a router that
> supplies a host list (for example, /lookuphost/), unless /hosts_override/ is
> set."
>
> I read this to mean that the hosts line in the transport will be ignored
> unless hosts_override is in there - am a I wrong?
>

Well, since you supply hosts with route_data, there is no point in those
other two options, is there? (I assume you have some smarthost router,
or a dnslookup router, for stuff you're not static routing )


> Incidentally, I thought of a couple of queries with regards to improving the
> "staticroutes" setup as follows:
>
> 1) If I was to put multiple entries for a domain in the staticroutes file,
> will Exim try each of them in order until one succeeds?
>

Yes, if you omit (I believe) hosts_randomize from the router. Check the
docs for the correct syntax for multiple destinations, I forget what it
is at the moment.


> 2) The transport specifically uses port 25. I was wondering if this could be
> a default setting but over-ridden if the staticroutes file contained a line
> such as:
>
> domain.com: 1.1.1.1:26
>
> I've only had to use an alternate port once when someone's broadband was
> down. They had a backup freephone dialup but port 25 was blocked on it. I had
> to write an entirely separate staticroutes2 to use an alternate port back
> then. It would be nice to have an easy option though!
>

You could probably do it with some string manipulation in the router
stanza, but remember that ':' is the default list separator. Perhaps
someone else can offer a more informed opinion on this. The only time
I ever run smtp on a non-standard port is when I run a 'test' copy of
my local exim on port 26, for trying out new stuff on my interal network.

--
--------------------------------------------------------
Dave Lugo dlugo [at] etherboy No spam, thanks.
Are you the police? . . . No ma'am, we're sysadmins.
--------------------------------------------------------

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


colin at southportcomputers

Oct 24, 2011, 12:25 AM

Post #7 of 7 (524 views)
Permalink
Re: Router/Transport Problem with multiple entries [In reply to]

On 24/10/2011 02:20, Dave Lugo wrote:
>
> Well, since you supply hosts with route_data, there is no point in those
> other two options, is there? (I assume you have some smarthost router,
> or a dnslookup router, for stuff you're not static routing )
>
Thank you for the clarification, I did not initially understand that the
information was passed between the two. I have removed it from the
transport and everything seems to be working fine now.

>> Incidentally, I thought of a couple of queries with regards to
>> improving the "staticroutes" setup as follows:
>>
>> 1) If I was to put multiple entries for a domain in the staticroutes
>> file, will Exim try each of them in order until one succeeds?
>>
>
> Yes, if you omit (I believe) hosts_randomize from the router. Check
> the docs for the correct syntax for multiple destinations, I forget
> what it
> is at the moment.
>
I've dug up chapter 20 of the docs which says the following format in
the file should work so I will set that up later:

dict.ref.example: mail-1.ref.example:mail-2.ref.example


>> 2) The transport specifically uses port 25. I was wondering if this
>> could be a default setting but over-ridden if the staticroutes file
>> contained a line such as:
>>
>> domain.com: 1.1.1.1:26
>>
>> I've only had to use an alternate port once when someone's broadband
>> was down. They had a backup freephone dialup but port 25 was blocked
>> on it. I had to write an entirely separate staticroutes2 to use an
>> alternate port back then. It would be nice to have an easy option
>> though!
>>
>
> You could probably do it with some string manipulation in the router
> stanza, but remember that ':' is the default list separator. Perhaps
> someone else can offer a more informed opinion on this. The only time
> I ever run smtp on a non-standard port is when I run a 'test' copy of
> my local exim on port 26, for trying out new stuff on my interal network.
>
Well I know that you can supply ports in route_list using double colons
(1.1.1.1::26). I wonder if it is as simple as removing the port = 25
line and using that syntax in /etc/staticroutes

That part is probably something I copied way back when I was getting
started and didn't really comprehend how it actually worked.

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.