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 recently purchased a VPS plan. I installed Ubuntu 9.10, PHP5 and Postfix. I can't get the PHP mail() function to work. In my PHP script, the mail() function returns true, which suggests it is working. But no one is receiving my website's emails.

Installation of postfix appeared to have went fine when I called a sudo apt-get install postfix. Calling a /etc/init.d/postfix start gave me "Starting Postfix Mail Transport Agent postfix ". Calling a /etc/init.d/postfix reload gave me the error "fatal: the Postfix mail system is not running".

Prior to installing postfix, I was using sendmail which worked with the PHP mail() function.

How do I debug and fix this problem?

Additional Notes I looked in /var/log/mail.log and found the follow error everytime i call php's mail()

Feb  3 11:27:41 mywebsitedomain postfix/postdrop[23793]: warning: unable to look up public/pickup: No such file or directory
share|improve this question
up vote 6 down vote accepted

Oh, I fixed the problem by following the information in this forum:

Basically, I looked in my /var/log/mail.log error file and found the error message "unable to look up public/pickup: no such file or directory".

I then issued the command

sudo mkfifo /var/spool/postfix/public/pickup

I made sure sendmail wasn't still running by doing a ps -aux and killing it

root@cpu:/var/log# ps aux | grep mail
root      2363  0.0  0.5   9228  1888 ?        Ss   Jan28   0:20 sendmail: MTA: accepting connections          
root     23914  0.0  0.2   3040   792 pts/0    S+   11:33   0:00 grep mail
root@cpu:/var/log# kill 2363

I restarted postfix

sudo /etc/init.d/postfix restart

And now the PHP mail function works.

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.