I followed these instructions in order to send mail and here's the Postfix log:

Sep 26 00:46:24 tshepang postfix/smtpd[5728]: 8EE2464931: client=localhost[]
Sep 26 00:47:44 tshepang postfix/cleanup[5810]: 8EE2464931: message-id=<20110925224624.8EE2464931@tshepang>
Sep 26 00:47:44 tshepang postfix/qmgr[5772]: 8EE2464931: from=<tshepang@gmail.com>, size=350, nrcpt=1 (queue active)
Sep 26 00:48:04 tshepang postfix/smtp[5859]: 8EE2464931: to=<tshepang.test@gmail.com>, relay=none, delay=127, delays=107/0.01/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)
Sep 26 00:48:39 tshepang postfix/smtpd[5728]: disconnect from localhost[]

Also, this may be relevant (from "/etc/postfix/main.cf"):

myhostname = tshepang
mydestination = tshepang, localhost
relayhost = 
mynetworks = [::ffff:]/104 [::1]/128
inet_interfaces = all
inet_protocols = all

I am running this on Debian 6.

  • Check your /etc/resolv.conf for invalid/non-responding resolvers. Try to do a host gmail.com; see if you get results. – laebshade Sep 25 '11 at 23:46
  • host gmail.com gives gmail.com has address on the line, and then ;; connection timed out; no servers could be reached on the second. But it's strange because I can ping it. – tshepang Sep 26 '11 at 0:23
  • 3
    How about host -t mx gmail.com ? You're right, though, this is somewhat odd. – Shadur Oct 20 '11 at 13:15
  • 1
    Another thought: can you add your /etc/resolv.conf to the question? – Shadur Oct 20 '11 at 13:21
  • 1
    Yeah. Signs point to a dodgy resolv.conf, possibly due to network-manager or resolvconf not quite playing ball. – Shadur Oct 22 '11 at 7:32

I used to have the same problem:

root@medusa:~# postqueue -p
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
079AC700080B      357 Wed Apr  3 13:47:47  root@medusa.yyyy.cz
(Host or domain name not found. Name service error for name=xxxx.cz type=MX: Host not found, try again)


root@medusa:~# host -t MX xxxx.cz
xxxx.cz mail is handled by 10 e2sgw01.xxxx.cz.
xxxx.cz mail is handled by 10 e2sgw02.xxxx.cz.


root@medusa:~# telnet e2sgw01.xxxx.cz. 25
Connected to e2sgw01.xxxx.cz.
Escape character is '^]'.
220 e2sgw01.xxxx.cz ESMTP Postfix

The problem was in /var/spool/postfix/etc/resolv.conf file (the chrooted one). Have a look at it.


Boosting a couple questions mentioned in comments that might help figure out what's going on:

  • Can you add your /etc/resolv.conf to the question? The output you describe from host gmail.com is a bit suspicious and could indicate an issue with your nameserver.

  • What, if any, response do you get from the command host -t mx gmail.com ?

  • Have you successfully sent mail to other systems from this computer?

  • Does your ISP have some kind of explicit policy that requires you to use their server as mail relay? If they do, a firewall blocking MX lookup requests might explain the weird behavior of host gmail.com timing out after getting a partial correct result.

  • I agree with this. It looks more like a DNS issue than a problem with Postifx (especially because of the no servers could be reached error from host). – bahamat Jun 21 '12 at 18:48

Try to disable the chroot property so that its not changerooted the /etc/postfix/master.cf as documented here

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd


# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd

It look like you are behind a proxy : gmail.com address is resolved, but the ping command does not succeed. You can try to connect directly gmail's SMTP with :

nc -w 1 gmail.com 25 ; echo $?

if it echoes "1", you can't connect, probably cause of security filtering.


As @Shadur pointed out, this issue could be due to your ISP (or the network where your server is installed). If there is a security restrictions on the SMTP port (port number 25), MX servers cannot by reached via this port.

You could try to use the SMTP over SSL port (ssmtp, port number 465) instead. To do this, edit the /etc/postfix/master.cf file, comment the smtp line and add a ssmtp line instead :

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
#smtp      inet  n       -       -       -       -       smtpd
ssmtp      inet  n       -       -       -       -       smtpd

To check that this post is recognized with this name on your machine, you can do :

$>cat /etc/services | grep smtp
smtp        25/tcp      mail
ssmtp       465/tcp     smtps       # SMTP over SSL

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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