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=<[email protected]>, 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=<[email protected]>, 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=<[email protected]>, 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=<[email protected]>
Dec 20 13:57:55 HD-T2597CL postfix/qmgr[8596]: 97A4618080B9: from=<[email protected]>, 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=<[email protected]>, 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...
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
IMHO Postfix bails out because it is confused about domain.org . Please run
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:
Every name is there once and there is clear distinction between loopback and external name/address.
After a lot of searching and testing I managed to find the solution:
That made it work.