Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

   ----- The following addresses had permanent fatal errors -----
<bob@subdomain.example.edu>

   ----- 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

--p3CFqmnx022071.1302624414/internal.example.edu
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.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

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