Sendmail or DNS? mail loops back to me (MX problem?)

stuart nichols stu at stac.state.tx.us
Sat Jan 13 04:56:50 UTC 2001




On Thu, 11 Jan 2001, Steven C. Job wrote:

> I am doing virtual hosts with sendmail.  And I have a bunch of domains
> in the system.  So I was just including the domain names in the
> /etc/mail/local-hosts flie.
 
> example of my file:
> > domain1.com
> > domain2.com
> > tiggee.com
> > domain4.com
 
> But then I get the following error when I try to send mail from one user
> on the machine to another user on the machine:
> > 553 5.3.5 server1.tiggee.com. config error: mail loops back to me
> >   (MX problem?)
> > 554 5.3.5 <job at winnie.tiggee.com>... Local configuration error

> I've tried everything to the DNS and it didn't work.  (I know I have it
> right.)

You probably do.
 
> I was able to get it to work when I add the following line to the
> /etc/mail/local-hosts file:

> > server1.tiggee.com

Yep.  That is what you have to do.  See below.
 
> Does this mean that I have to add a line to the localhosts file for
> every subdomain I would like mail sent to?  This can't be right...
> Someone please tell me how wrong I am.

You aren't wrong.  There is no way to tell from the DNS records
whether an MX record means that a particular mail host is
expected to actually deliver the message to the recipient, or
do something else with it, such as hold onto it for a while
until the real mail host comes back on line.  Since the DNS
records give no clue, sendmail has to have a way of distinguishing
which messages should be delivered locally, rather than being
relayed on to their final destination.

Example:

stac.state.tx.us.  in  mx  10  vixie.stac.state.tx.us.
                   in  mx  20  ogre.stac.state.tx.us.
                   in  mx  30  tomcat.stac.state.tx.us.

Vixie is where I read my mail, and the host from which I am
sending this message.  Vixie is the final delivery mail host
for stac.state.tx.us.

Vixie's sendmail has this line in the local-host-names file:

  stac.state.tx.us

When you send a message to stu at stac.state.tx.us it goes to
vixie because vixie has the lowest numbered MX record.  Vixie's
sendmail knows from the record in the local-host-names file
that the message should be delivered locally (according to
local alias file rules, or to a local account named "stu").

But vixie is sometimes unavailable for one reason or another.
(Rare, since it is FreeBSD, but it has happened twice in
the past two years.)  Ogre gets the mail message for stu,
because it has the next lowest MX record.  Ogre's sendmail
does NOT have a local-host-names record for stac.state.tx.us,
so ogre queues the message, knowing that later on it should
try to send the message to stac.state.tx.us.  Ogre does not
attempt to deliver the message to "stu", even if there is
such an account named "stu" on ogre.

Ogre occassionally tries to deliver the message to the
lowest available MX record for stac.state.tx.us.  
When vixie pops back up then ogre will transfer the message
to vixie.  Don't worry about why I care whether the mail
sits on your machine or one of my machines while we wait
for vixie to come back up.

Notice that if that first "MX  10" record pointing to vixie
gets deleted, we have a problem.  Ogre gets the message,
but altho it has no rules telling it how to deliver the
message locally, it has the lowest-numbered MX record.
Ogre's sendmail is confused because the MX record "loops back".
It can't deliver the message locally, and the destination to
which it should supposedly relay the message is itself.  It 
has to give up because there is no way to tell what was the
intension of the mail administrator.  It sends out that
"loops back to myself" message.


--

stu
office: (512) 463-7601
FAX:    (512) 475-4759

stuart nichols
State Technology Assessment Center
Texas Department of Information Resources
300 West 15th Street
Suite 1300
Austin  TX  78701






More information about the bind-users mailing list