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

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

1 Answer 1

up vote 6 down vote accepted

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

http://ubuntuforums.org/showthread.php?t=666018

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

 
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.