Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to send mail via PHP's mail() function, but it hangs the script. I tried using sendmail on command line (CentOS 5.8) as was suggested in many posts I've read but it also hangs. This is what im putting in:

sendmail -v < message.txt

which says: Connecting to [] via relay...

and that's it. It hangs there.

Here are the last 2000 lines of logs from /var/log/maillog: logs

I'm clueless as to how to continue debugging this issue, please advise.

share|improve this question
What do your logs say? /var/log/syslog, /var/log/mail.log, /var/log/mail.err ? – Lucas Kauffman Jul 30 '12 at 9:33
Ok, let's tackle the elephant in the room... Have you configured a mail server/relay on your machine? – Bart De Vos Jul 30 '12 at 9:43
Are you on a virtual machine? If so can you post the output of iptables -L ? – adamo Jul 30 '12 at 10:07
@BartDeVos no, I don't know how to do that or what that means. adamo I'm not on a virtual machine. Added logs to the question – MeLight Jul 30 '12 at 10:48
up vote 0 down vote accepted

I've uninstalled sendmail and postfix and then installed postfix again. That fixed it for for me.

I did this:

$ yum remove sendmail
$ yum remove postfix
$ yum install postfix
$ service postfix start
share|improve this answer

Your Answer


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.