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>
Subject: Warning: could not send message for past 4 hours
Auto-Submitted: auto-generated (warning-timeout)
[-- 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
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:
Following the directions in this thread, I've found the following in /var/log/maillog:
Jun 2 09:55:56 apollo sendmail: My unqualified host name (apollo) unknown; sleeping for retry
Jun 2 09:56:30 apollo sendmail: 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
(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.
; generated by /sbin/dhclient-script
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 22.214.171.124
;; 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!