Page 1 of 1

mail loops back to me

Posted: Thu May 11, 2006 7:34 pm
by mephisto
I set up a test system and I'm getting these errors for incoming mails:

Code: Select all

May 12 01:29:08 lvps87-230-6-89 sendmail[9981]: k4BNT7P5009981: from=<me@outside.com>, size=5480, class=0, nrcpts=1, msgid=<H0000074000f4311.1147390141.mail.outside.com@MHS>, proto=ESMTP, relay=root@localhost
May 12 01:29:08 lvps87-230-6-89 sm-mta[9982]: k4BNT8HO009982: from=<me@outside.com>, size=5703, class=0, nrcpts=1, msgid=<H0000074000f4311.1147390141.mail
.outside.com@MHS>, proto=ESMTP, daemon=MSP-v4, relay=smmsp@localhost [127.0.0.1]
May 12 01:29:08 lvps87-230-6-89 sendmail[9981]: k4BNT7P5009981: to=<mail@mydomain.com>, delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=35480, relay=[127.0.0.
1] [127.0.0.1], dsn=2.0.0, stat=Sent (k4BNT8HO009982 Message accepted for delivery)
May 12 01:29:08 lvps87-230-6-89 sm-mta[9991]: k4BNT8HO009982: SYSERR(root): mail.mydomain.com. config error: mail loops back to me (MX problem?)
May 12 01:29:08 lvps87-230-6-89 sm-mta[9991]: k4BNT8HO009982: to=<mail@mydomain.com>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=125703, relay=mail.fredo
.org. [87.230.6.89], dsn=5.3.5, stat=Local configuration error
May 12 01:29:08 lvps87-230-6-89 sm-mta[9991]: k4BNT8HO009982: k4BNT8HO009991: DSN: Local configuration error
May 12 01:29:08 lvps87-230-6-89 sm-mta[9991]: k4BNT8HO009991: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=60000, dsn=2.0.0, stat=Sent
May 12 01:29:19 lvps87-230-6-89 sm-mta[9991]: k4BNT8HO009991: to=<me@outside.com>, delay=00:00:11, xdelay=00:00:11, mailer=esmtp, pri=60000, relay=mail.di
ffferent.de. [82.144.63.193], dsn=2.0.0, stat=Sent (2.0.0 k4BNT8B6011833 Message accepted for delivery)


My MX and DNS is setup correctly for my mailserver's domain and this is my (anonymized) /etc/hosts.conf

Code: Select all

127.0.0.1 localhost localhost.localdomain
87.230.X.Y lvps87-230-X-Y.dedicated.hosteurope.de lvps87-230-X-Y


/etc/mail/local-host-names:

Code: Select all

localhost
lvps87-230-X-Y.dedicated.hosteurope.de
mail.mydomain.com

Posted: Thu May 11, 2006 8:07 pm
by ScalixSupport
You need to add mydomain.com to /etc/mail/local-host-names and restart sendmail.

Cheers

Dave

Posted: Thu May 11, 2006 8:16 pm
by mephisto
Did that, but it still doesn't work. This is what the sender gets back:

Code: Select all

----------------------------- ERROR REPORT ----------------------------- Message could not be delivered to the following recipient:

        mail / internet
                        DDT1=RFC-822; DDV1=mail@mydomain.com;

    because: Unknown Non-Delivery Reason (535)
------------------------------------------------------------------------

Posted: Fri May 12, 2006 1:05 am
by leigh
This is a fairly well known issue in sendmail.
Have a look here:
http://www.sendmail.org/faq/section4.html#4.5
You did restart sendmail when you made those changes, right?

Posted: Fri May 12, 2006 8:39 am
by mephisto
Yes, I restarted sendmail. It looks like sendmail is only partly honoring my changes to /etc/mail/local-host-names. If I change it to accept a certain domain I can drop off a mail using telnet to port 25. The strange thing is that sendmail seems to look up the MX of that domain anyway. This results in the described error if my server is the MX or in a simple forward to the MX if my server isn't it.

Posted: Fri May 12, 2006 8:47 am
by mephisto
OK, I found it: these lines where missing in my sendmail.cf:

Cwlocalhost
# file containing names of hosts for which we receive email
Fw/etc/mail/local-host-names