Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to send mail to root@localhost but no matter what I try it doesn't work. I always get DNS lookup errors:

Dec 20 10:08:56 HD-T2597CL sendmail[4408]: nBKF8uEu004408: from=root@Server1, size=451, class=0, nrcpts=1, msgid=<1261321735.4404@Server1>, relay=root@localhost
Dec 20 10:08:56 HD-T2597CL postfix/smtpd[4409]: connect from Server1[127.0.0.1]
Dec 20 10:08:56 HD-T2597CL postfix/smtpd[4409]: 075FE18080C4: client=Server1[127.0.0.1]
Dec 20 10:08:56 HD-T2597CL postfix/cleanup[4412]: 075FE18080C4: message-id=<1261321735.4404@Server1>
Dec 20 10:08:56 HD-T2597CL postfix/qmgr[3791]: 075FE18080C4: from=<root@localhost.localdomain>, size=495, nrcpt=1 (queue active)
Dec 20 10:08:56 HD-T2597CL sendmail[4408]: nBKF8uEu004408: to=root@localhost, ctladdr=root@Server1 (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30451, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 075FE18080C4)
Dec 20 10:08:56 HD-T2597CL postfix/smtpd[4409]: disconnect from Server1[127.0.0.1]
Dec 20 10:08:56 HD-T2597CL postfix/smtp[4413]: 075FE18080C4: to=<root@localhost.localdomain>, relay=none, delay=0.05, delays=0.05/0/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=localhost.localdomain type=MX: Host not found, try again)
Dec 20 13:57:55 HD-T2597CL sendmail[8885]: nBKIvtng008885: from=root@Server1, size=453, class=0, nrcpts=1, msgid=<200912201857.nBKIvtng008885@localhost.localdomain>, relay=root@localhost
Dec 20 13:57:55 HD-T2597CL postfix/smtpd[8686]: connect from Server1[127.0.0.1]
Dec 20 13:57:55 HD-T2597CL postfix/smtpd[8686]: 97A4618080B9: client=Server1[127.0.0.1]
Dec 20 13:57:55 HD-T2597CL postfix/cleanup[8689]: 97A4618080B9: message-id=<200912201857.nBKIvtng008885@localhost.localdomain>
Dec 20 13:57:55 HD-T2597CL postfix/qmgr[8596]: 97A4618080B9: from=<root@localhost.localdomain>, size=611, nrcpt=1 (queue active)
Dec 20 13:57:55 HD-T2597CL sendmail[8885]: nBKIvtng008885: to=chris@localhost, ctladdr=root@Server1(0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30453, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 97A4618080B9)
Dec 20 13:57:55 HD-T2597CL postfix/smtp[8690]: 97A4618080B9: to=<chris@localhost.localdomain>, relay=none, delay=0.04, delays=0.04/0/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=localhost.localdomain type=MX: Host not found, try again)
Dec 20 13:57:55 HD-T2597CL postfix/smtpd[8686]: disconnect from Server1[127.0.0.1]

My config is set to:

mydomain = domain.org
myhostname = mail.domain.org
myorigin = domain.org

Options using the default settings: inet_interfaces mydestination

my /etc/hosts file:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1   Server1 localhost.localdomain localhost
::1 	localhost6.localdomain6 localhost6
209.x.x.x   Server1

I have no idea what to do now...

share|improve this question

3 Answers 3

After a lot of searching and testing I managed to find the solution:

  1. I switched from the OpenDNS resolvers to the ones that my webhost provides.
  2. Then I added mydestination = $myhostname, localhost.localdomain, localhost to the Postfix configuration as AlekSandar mentioned

That made it work.

share|improve this answer

IMHO Postfix bails out because it is confused about domain.org . Please run

hostname -f

and check if result:

1.is sane (it should be Server1.domain.org . If not, tidy up the /etc/hosts as described below)

2.resolves to valid IP address of the server (can be found in /etc/hosts)

Again,IMHO - the "localdomain" thingy is an abomination that is good for nothing but headache and I get rid of it/replace it with real domain as soon as a server is put into my hands. I usually put into the /etc/hosts something like:

127.0.0.1   localhost.domain.org localhost
209.x.x.x   Server1.domain.org Server1

Every name is there once and there is clear distinction between loopback and external name/address.

share|improve this answer

check that localhost is listed under mydestination

this is the default, but you probably have something else

mydestination = $myhostname, localhost.$mydomain, localhost

also check that you dont have relayhost set and that /etc/postfix/transport is empty

check also that root is not aliased to anything in /etc/aliases

share|improve this answer
    
I've tried your suggestion but it's still not working and before that it was set to default settings. I've tried sending mail to root@localhost, root@Server1 and different users. –  EarthMind Dec 20 '09 at 18:59
    
Oh, and my mail server does not use the 209.x.x.x IP address but another one. Does this IP need to be on the hosts file too? –  EarthMind Dec 20 '09 at 19:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.