Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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[127.0.0.1]
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[127.0.0.1]

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

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

I am running this on Debian 6.

share|improve this question
    
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 74.125.233.24 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
1  
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
show 3 more comments

3 Answers 3

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.

share|improve this answer
    
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
add comment

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)
                                         hmls@xxxx.cz

..

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
Trying 217.77.161.168...
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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.