PDA

View Full Version : Help Greatly Appreciated -> sendmail: host name lookup failure



Josh Hughey
3rd June 2006, 07:52 PM
Hello Everyone,

After hours of googling and searching, I've managed to trace a php mail() problem to the fact that sendmail isn't working correctly on my FC5 box that I have internally on my network.

Basic symptoms: php mail() function "lags" for a very long time, so I tried using mutt to send mail - same issue. Then I receive messages in the root inbox that have a subject of:


Jun 02 Mail Delivery S ( 135) Warning: could not send message for past 4 hours


Reading such messages reveals the following attached at the top of the original message my code was trying to send:


Date: Fri, 2 Jun 2006 14:10:31 -0500
From: Mail Delivery Subsystem <MAILER-DAEMON@apollo>
To: <apache@apollo>
Subject: Warning: could not send message for past 4 hours
Auto-Submitted: auto-generated (warning-timeout)
X-Evolution: 00000010-0020

[-- Attachment #1 --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.5K --]

**********************************************
** THIS IS A WARNING MESSAGE ONLY **
** YOU DO NOT NEED TO RESEND YOUR MESSAGE **
**********************************************

The original message was received at Fri, 2 Jun 2006 09:52:52 -0500
from localhost.localdomain [127.0.0.1]

----- Transcript of session follows -----
<OBFUSCATED@ionexinteractive.com>... Deferred: Name server: ionexinteractive.com.: host name lookup failure
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old

[-- Attachment #2 --]
[-- Type: message/delivery-status, Encoding: 7bit, Size: 0.3K --]

Reporting-MTA: dns; apollo
Arrival-Date: Fri, 2 Jun 2006 09:52:52 -0500

Final-Recipient: RFC822; OBFUSCATED@ionexinteractive.com
Action: delayed
Status: 4.2.0
Remote-MTA: DNS; ionexinteractive.com
Last-Attempt-Date: Fri, 2 Jun 2006 14:10:31 -0500
Will-Retry-Until: Wed, 7 Jun 2006 09:52:52 -0500


Of course, I've accessed the website (I was sending test messages to myself) through the server, and www.ionexinteractive.com pulls up just fine, as does everything else.

The only thing I've been able to find similar to my issue is an unfinished thread here:
http://www.fedoraforum.org/forum/showthread.php?t=110693&highlight=host+lookup+failure+sendmail

Following the directions in this thread, I've found the following in /var/log/maillog:


Jun 2 09:55:56 apollo sendmail[5863]: My unqualified host name (apollo) unknown; sleeping for retry
Jun 2 09:56:30 apollo sendmail[5859]: unable to qualify my own domain name (apollo) -- using short name


These lines recur several times in the log. Apollo is the hostname of this computer, and I've made some basic changes in /etc/hosts so that it can communicate with other computers on my network:



# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.99 apollo


(The IP above was set statically.)

Now I'm no DNS genius, and in fact quite wet behind the ears when it comes to systems administration tasks such as this, but if a web browser can easily access any valid FQDN out there, shouldn't sendmail be able to resolve them as well?

Because I've seen people in the past ask for the contents of certain files, I'm going to paste here the contents of some files I think may help figure this one out.



/etc/resolv.conf

; generated by /sbin/dhclient-script
search localdomain
nameserver 192.168.1.1


At first, that nameserver was set as 192.168.15.1 - which I have NO IDEA what it is. So I changed it back to the IP address of my linksys router, which I know should work. In both instances, the server is easily able to pull up any web document, but sendmail still does not send.

A dig from my server for the domain I'm trying to send mail to reveals the following:


[root@apollo ~]# dig ionexinteractive.com

; <<>> DiG 9.3.2 <<>> ionexinteractive.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31601
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ionexinteractive.com. IN A

;; ANSWER SECTION:
ionexinteractive.com. 51895 IN A 69.20.107.248

;; Query time: 3 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Jun 3 13:45:17 2006
;; MSG SIZE rcvd: 54


Any help anyone could provide would be greatly appreciated!

jcliburn
4th June 2006, 03:26 PM
Is port 25 outbound unblocked? Does your outbound mail require a relay through another SMTP server (say, your ISP's)? If so, does your ISP allow SMTP relay? Many ISPs will block port 25 traffic to prevent spam emanating from home SMTP servers.

Josh Hughey
5th June 2006, 01:28 AM
Hi jcliburn,

No, my ISP doesn't require any of those items, to the best of my knowledge. I can send e-mail easily through any other machine on my network using an e-mail client ("Mail" with OS X for example). Any other ideas?

Thanks,
Josh

jcliburn
5th June 2006, 02:09 AM
There's a difference between sending mail using a mail client, like thunderbird, evolution, or some other graphical mail tool, and sending it from an SMTP server running sendmail located on a machine inside your LAN. In those graphical clients, you have to specify an outgoing SMTP server; often this is not a machine inside your LAN, but is instead your ISP's mail server.

When you use "Mail" on your Mac, is it the command line BSD version of Mail, i.e. /usr/bin/Mail, or is it a graphical tool?

The reason I'm focusing on this issue is because your problem has all the hallmarks of an inability of your sendmail server to contact an upstream mail server. From your sendmail server, can you "telnet isp.mail.server 25"? Here's what I'm talking about.

shrike:~ jcliburn$ telnet mail.bellsouth.net 25
Trying 205.152.59.17...
Connected to mail.bellsouth.net.
Escape character is '^]'.
220 ibm65aec.bellsouth.net ESMTP server ready Sun, 4 Jun 2006 21:06:39 -0400
EHLO <<<<<<<<<------------- I entered this command
250-ibm65aec.bellsouth.net
250-HELP
250-PIPELINING
250-DSN
250-8BITMIME
250 SIZE 26214400
QUIT <<<<<<<<<------------- I entered this command
221 ibm65aec.bellsouth.net ESMTP server closing connection
Connection closed by foreign host.
shrike:~ jcliburn$

Josh Hughey
5th June 2006, 11:02 PM
I wasn't aware there was a difference - thanks for sharing that! When I say "Mail" I mean the OS X graphical mail tool (http://www.apple.com/macosx/features/mail/).

I tried the diagnostics you did, and came out with pretty-much the same thing, except that they asked me for a domain name (so I just plugged in mine) - observe:


[root@apollo named]# telnet smtp-server.austin.rr.com 25
Trying 24.93.40.21...
Connected to smtp-server.austin.rr.com (24.93.40.21).
Escape character is '^]'.
220 ms-smtp-05.texas.rr.com ESMTP Welcome to Road Runner. WARNING: *** FOR AUTHORIZED USE ONLY! ***
EHLO
501 5.0.0 EHLO requires domain address
EHLO ionexinteractive.com
250-ms-smtp-05.texas.rr.com Hello cpe-24-28-93-227.austin.res.rr.com [24.28.93.227], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 20971520
250-ETRN
250-DELIVERBY
250 HELP
QUIT
221 2.0.0 ms-smtp-05.texas.rr.com closing connection
Connection closed by foreign host.
[root@apollo named]#


I'm stumped =( Any other ideas?

Thanks again for helping me out!
Josh

ccrvic
6th June 2006, 12:58 AM
Jun 2 09:55:56 apollo sendmail[5863]: My unqualified host name (apollo) unknown; sleeping for retry
Jun 2 09:56:30 apollo sendmail[5859]: unable to qualify my own domain name (apollo) -- using short name


It would appear your machine isn't happy with its name...

What do you get from :

cat /etc/sysconfig/network
sendmail -d0

Vic.

jcliburn
6th June 2006, 01:26 AM
You have what seems to be a good pathway to your ISP's mail server, as validated by the telnet command, so that's removed as a possible culprit. I use postfix, not sendmail (easier to configure), so my help henceforth will be limited. Thanks to ccrvic for stepping in.

Josh Hughey
6th June 2006, 01:33 AM
Thanks for the replies guys.

jcliburn - thanks for your help thus far. Any other ideas you may have will be greatly appreciated!

ccrvic - Thanks for your help (and indeed, for stepping in). Here's the output of those two commands:


[root@apollo named]# sendmail -d0
Version 8.13.6
Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
TCPWRAPPERS USERDB USE_LDAP_INIT

============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = apollo
(canonical domain name) $j = apollo
(subdomain name) $m = <null>
(node name) $k = apollo
================================================== ======

Recipient names must be specified

...at this point it just hangs until I hit control-c...




[root@apollo named]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=apollo


Not sure what these mean, but I hope this helps!
Josh