Jaspert Tandy just saved my life. Okay, maybe not, but he sure did make my day this morning. Why? He has a great post that gives you some simple steps to fix problems with sendmail/postfix on OS X (Leopard).
I updated OS X and all of a sudden my local PHP installation isn’t sending mail. No errors, no warnings. Everything functions correctly but the mail never actually makes it to the inbox.
Open terminal, you’ll need it:
sudo nano -w /etc/hostconfigin Terminal. Look for the line starting
MAILSERVER=, if you don’t see it, add it and make sure it reads:
sudo cp /etc/postfix/main.cf /etc/postfix/main.cf.org
sudo nano -w /etc/postfix/main.cf and find the lines defining the
myhostname variable. Remove the leading number/pound sign (
#) to uncomment the declaration and set it’s value to something you own, or something you can recognize.
Note that if you set this to something obscure like I have, your email messages without
from: headers will send from your Apache user (mine’s
_www) at this domain. For instance, my emails send from
firstname.lastname@example.org. These tend to be blocked by Gmail’s spam filter (and probably most spam filters).
php.inifile and uncomment the
sendmail_pathvariable by deleting the leading semicolon (
Set its value to
sendmail -t -i so that line reads:
sendmail_path = "sendmail -t -i"
Restart Apache so the setting applies to you PHP install.
Did it work for you? Send Jasper some love and thank him. This is an aggregation of his solution and a journal of what helped me, in hopes that his solution can reach more people.
Thanks again, Jasper.