Mailing List Archive

Email Loops
I had an interesting problem. Email started looping between the second and
third MX servers for my domain.

More details:
DNS says mydomain.com
preference 0 mail.mydomain.com
preference 5 mail.second.com
preference 10 mail.third.com

Sitting at mail.second.com, I sent an email to someone at mydomain.com
1) mail.mydomain.com was down.
2) Email was sent to mail.second.com
3) Email was sent to mail.third.com
4) Email was send to mail.second.com
and on and on until it failed.

All three email servers are running Exim.
I have checked ALL listed DNS servers, and all agree that the order of
preference is as listed above.

Does anyone have any suggestions or clues as what is happening?


Thank You

Terry Shows
Computer Software Specialists LLC
terry.shows@csstn.com <mailto:terry.shows@csstn.com>
Re: Email Loops [ In reply to ]
On Mon, Jul 08, 2002 at 11:31:12AM -0500, Terry Shows wrote:
> More details:
> DNS says mydomain.com
> preference 0 mail.mydomain.com
> preference 5 mail.second.com
> preference 10 mail.third.com
>
> Sitting at mail.second.com, I sent an email to someone at mydomain.com
> 1) mail.mydomain.com was down.
> 2) Email was sent to mail.second.com
> 3) Email was sent to mail.third.com
> 4) Email was send to mail.second.com

/path/to/exim -bt someone@mydomain.com on mail.second.com to see why it is
sending mail to a higher priority MX, mail.third.com, should point you in the
right direction.

Ollie

--
Oliver Cook Systems Administrator, ClaraNET
ollie@uk.clara.net 020 7903 3065
Re: Email Loops [ In reply to ]
On Mon, Jul 08, 2002 at 11:31:12AM -0500,
Terry Shows <Terry.Shows@csstn.com> is thought to have said:

> I had an interesting problem. Email started looping between the second and
> third MX servers for my domain.
>
> More details:
> DNS says mydomain.com
> preference 0 mail.mydomain.com
> preference 5 mail.second.com
> preference 10 mail.third.com
>
> Sitting at mail.second.com, I sent an email to someone at mydomain.com
> 1) mail.mydomain.com was down.
> 2) Email was sent to mail.second.com
> 3) Email was sent to mail.third.com
> 4) Email was send to mail.second.com
> and on and on until it failed.
>
> All three email servers are running Exim.
> I have checked ALL listed DNS servers, and all agree that the order of
> preference is as listed above.
>
> Does anyone have any suggestions or clues as what is happening?

I've seen this sort of thing happen when the mail servers were behind
something where address translation was going on so the system's IP
address was not the same as the public facing IP address seen in the MX
records. Do you have something like that setup withese these hosts?

--
--------------------------------------------------------------------
Tabor J. Wells twells@fsckit.net
Fsck It! Just another victim of the ambient morality
RE: Email Loops [ In reply to ]
Yes, this is exactly my configuration. All three servers are behind routers
using NAT, and having a "real" private 192.168 address.

Does anyone have an explanation, or maybe a suggestion how to stop this?

Thanks again
Terry

-----Original Message-----
From: Tabor J. Wells [mailto:twells@fsckit.net]
Sent: Monday, July 08, 2002 12:00 PM
To: Terry Shows
Cc: exim-users@exim.org
Subject: Re: [Exim] Email Loops


On Mon, Jul 08, 2002 at 11:31:12AM -0500,
Terry Shows <Terry.Shows@csstn.com> is thought to have said:

> I had an interesting problem. Email started looping between the second
and
> third MX servers for my domain.
>
> More details:
> DNS says mydomain.com
> preference 0 mail.mydomain.com
> preference 5 mail.second.com
> preference 10 mail.third.com
>
> Sitting at mail.second.com, I sent an email to someone at mydomain.com
> 1) mail.mydomain.com was down.
> 2) Email was sent to mail.second.com
> 3) Email was sent to mail.third.com
> 4) Email was send to mail.second.com
> and on and on until it failed.
>
> All three email servers are running Exim.
> I have checked ALL listed DNS servers, and all agree that the order of
> preference is as listed above.
>
> Does anyone have any suggestions or clues as what is happening?

I've seen this sort of thing happen when the mail servers were behind
something where address translation was going on so the system's IP
address was not the same as the public facing IP address seen in the MX
records. Do you have something like that setup withese these hosts?

--
--------------------------------------------------------------------
Tabor J. Wells twells@fsckit.net
Fsck It! Just another victim of the ambient morality
Re: Email Loops [ In reply to ]
On Mon, Jul 08, 2002 at 12:03:26PM -0500,
Terry Shows <Terry.Shows@csstn.com> is thought to have said:

> Yes, this is exactly my configuration. All three servers are behind routers
> using NAT, and having a "real" private 192.168 address.
>
> Does anyone have an explanation, or maybe a suggestion how to stop this?

You can stop this by using a manuralroute router for your local domains
(manualroute is the Exim 4 equivalent of the Exim 3 domainlist router) to
send mail for those domains directly to the internal ips.

You might also be able to make use of ignore_target_hosts on the backup MXes
for the public IPs of the backup MXes.

--
--------------------------------------------------------------------
Tabor J. Wells twells@fsckit.net
Fsck It! Just another victim of the ambient morality
RE: Email Loops [ In reply to ]
Tabor,

Thanks for the responses, the only problem is that the hosts are not located
in the same location (each is in offices located several hundred miles
apart), so I have to address each of them with their public address.

Using the "ignore_target_host" will stop email traffic between the two hosts
won't it? This too would be unacceptable.

If anyone has any other ideas, please pass them on. I have just about run
out of ideas.

By the way, I am still running Exim 3.x. Sorry, I haven't had time to
convert to 4 yet.

Thanks
Terry

-----Original Message-----
From: Tabor J. Wells [mailto:twells@fsckit.net]
Sent: Monday, July 08, 2002 12:22 PM
To: Terry Shows
Cc: exim-users@exim.org
Subject: Re: [Exim] Email Loops


On Mon, Jul 08, 2002 at 12:03:26PM -0500,
Terry Shows <Terry.Shows@csstn.com> is thought to have said:

> Yes, this is exactly my configuration. All three servers are behind
routers
> using NAT, and having a "real" private 192.168 address.
>
> Does anyone have an explanation, or maybe a suggestion how to stop this?

You can stop this by using a manuralroute router for your local domains
(manualroute is the Exim 4 equivalent of the Exim 3 domainlist router) to
send mail for those domains directly to the internal ips.

You might also be able to make use of ignore_target_hosts on the backup MXes
for the public IPs of the backup MXes.

--
--------------------------------------------------------------------
Tabor J. Wells twells@fsckit.net
Fsck It! Just another victim of the ambient morality
Re: Email Loops [ In reply to ]
On Mon, Jul 08, 2002 at 01:23:44PM -0500,
Terry Shows <Terry.Shows@csstn.com> is thought to have said:

> Thanks for the responses, the only problem is that the hosts are not located
> in the same location (each is in offices located several hundred miles
> apart), so I have to address each of them with their public address.

There is no reason you can't use something like

route_list = "example.com mail.example.com bydns_a"

> Using the "ignore_target_host" will stop email traffic between the two hosts
> won't it? This too would be unacceptable.

if the backup mx needs to talk to the third mx then yes.

> If anyone has any other ideas, please pass them on. I have just about run
> out of ideas.

You could also change the MX pref to so that both of the backups have the
same preference, but then this may not be ideal for your purposes either if
you really don't want mail to get to the lowest MX unless absolutely
necessary.

--
--------------------------------------------------------------------
Tabor J. Wells twells@fsckit.net
Fsck It! Just another victim of the ambient morality
Re: Email Loops [ In reply to ]
On Mon, Jul 08, 2002 at 02:41:29PM -0400,
Tabor J. Wells <twells@fsckit.net> is thought to have said:

> You could also change the MX pref to so that both of the backups have the
> same preference, but then this may not be ideal for your purposes either if
> you really don't want mail to get to the lowest MX unless absolutely
> necessary.

I'm sorry I was apparantly drunk when I wrote that. This won't make a
difference to your problem.

Look at the hosts_treat_as_local option as well.

--
--------------------------------------------------------------------
Tabor J. Wells twells@fsckit.net
Fsck It! Just another victim of the ambient morality
RE: Email Loops [ In reply to ]
Tabor,

Thanks again for the help.

I added the route_list option as you specified in the routers section, but I
get an error from exim saying that "Exim configuration error option
"route_list" unknown in line 467"

Could this be an Exim 4 only option? OR am I trying to put it in the wrong
section. I assumed that this would be a router option. (It is in the
spec.txt for exim 3, so I don't think that it is an invalid option)

Thanks in advance
Terry

-----Original Message-----
From: exim-users-admin@exim.org [mailto:exim-users-admin@exim.org]On
Behalf Of Tabor J. Wells
Sent: Monday, July 08, 2002 1:41 PM
To: Terry Shows
Cc: exim-users@exim.org
Subject: Re: [Exim] Email Loops


On Mon, Jul 08, 2002 at 01:23:44PM -0500,
Terry Shows <Terry.Shows@csstn.com> is thought to have said:

> Thanks for the responses, the only problem is that the hosts are not
located
> in the same location (each is in offices located several hundred miles
> apart), so I have to address each of them with their public address.

There is no reason you can't use something like

route_list = "example.com mail.example.com bydns_a"

> Using the "ignore_target_host" will stop email traffic between the two
hosts
> won't it? This too would be unacceptable.

if the backup mx needs to talk to the third mx then yes.

> If anyone has any other ideas, please pass them on. I have just about run
> out of ideas.

You could also change the MX pref to so that both of the backups have the
same preference, but then this may not be ideal for your purposes either if
you really don't want mail to get to the lowest MX unless absolutely
necessary.

--
--------------------------------------------------------------------
Tabor J. Wells twells@fsckit.net
Fsck It! Just another victim of the ambient morality

--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##
Re: Email Loops [ In reply to ]
On Mon, Jul 08, 2002 at 02:29:06PM -0500,
Terry Shows <Terry.Shows@csstn.com> is thought to have said:

> I added the route_list option as you specified in the routers section, but I
> get an error from exim saying that "Exim configuration error option
> "route_list" unknown in line 467"
>
> Could this be an Exim 4 only option? OR am I trying to put it in the wrong
> section. I assumed that this would be a router option. (It is in the
> spec.txt for exim 3, so I don't think that it is an invalid option)

It is an option to a router. Not an option for the routers section.

For example you might have a router that looks like:

localroute:
driver = domainlist
transport = remote_smtp
route_list = "example.com mail.example.com bydns_a"

before your lookuphost router in the routers section of your config.

--
--------------------------------------------------------------------
Tabor J. Wells twells@fsckit.net
Fsck It! Just another victim of the ambient morality