I'm trying to debug a problem with sending mail on a Red Hat/Apache server. When I send email from the command line using sendmail -t, I get bounce-back emails with messages like this:

The original message was received at Thu, 7 Apr 2011 10:24:56 -0500
from internal.example.edu []

   ----- The following addresses had permanent fatal errors -----

   ----- Transcript of session follows -----
<bob@subdomain.example.edu>... Deferred: Connection timed out with mail.global.frontbridge.com.
Message could not be delivered for 5 days
Message will be deleted from queue

Content-Type: message/delivery-status

Reporting-MTA: dns; internal.example.edu
Arrival-Date: Thu, 7 Apr 2011 10:24:56 -0500

Final-Recipient: RFC822; bob@subdomain.example.edu
Action: failed
Status: 4.4.7
Remote-MTA: DNS; mail.global.frontbridge.com
Last-Attempt-Date: Tue, 12 Apr 2011 11:06:54 -0500

That timeout talking to mail.global.frontbridge.com is likely the cause of the problem. BUT, it has been suggested that this particular timeout was caused because sending the test email from the command line caused the local MTA to identify itself using the name "internal.example.edu", causing the remote MTA to reject the message because it didn't recognize our interal-only DNS.

The original problem was identified when some PHP scripts on the server started failing to send mail correctly. Those scripts are accessed through a web browser (obviously) using a valid external name for the server.

So basically, I want to check the apache user's local mail spool to see if there are bounce emails there that would take the internal/external name thing out of the equation and possibly shed some more light on the matter. Is that possible? Does the apache user even HAVE a mail spool?

I tried sending some mails with the Return-Path header set to an email address I control ... but since the whole problem is that the server can't send email right, that didn't work.


Check if /var/spool/mail/<apache user> exists, it's the mail file. You can read it with a text editor or you can configure mutt to check it locally (change the $SPOOLFILE environment variable to make it check a file other than the default.

EDIT: I am not sure if Red Hat's mail spool is /var/spool/mail, so you may have to poke around to confirm it.

  • Red Hat's mail spool is indeed at /var/spool/mail -- I found the spool for my own user there. Sadly, there's nothing for the apache user on this system, but now I know where to look. Thanks. – Will Martin Apr 13 '11 at 1:36

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.