Ssmtp and PHP's mail()
Oh hell, that took me 2 days to get it working. To get mail() working in PHP, use /usr/sbin/ssmtp -t -i in php.ini and do not forget to add the revalias for apache.
And don’t ask me why, it suddenly works.
I tried to build with mailwrapper support, turned out we do not need that at all. Tried with a different ssmtp build (the original didn’t even include /usr/(s)bin/sendmail), nope. Found out that ssmtp actually doesn’t like the -t and was therefore complaining about ssmtp: No recipients supplied - mail will not be sent. The gmail SSL port 465 magically stopped working for me. I have no idea, and i’m guessing it was the aliens again.
So, mail is working on Seraph now.
Though i’m thinking about setting up something more advanced.. something that uses queues so people don’t have to wait till the mail is sent, and if the connection to the mail server fails, it will resend. But, not in a few months.
DiSH Says:
in gentoo-hardened it’s not so simple :(
I could not manage to get it working and installed old-fashioned sendmail.