Sendmail on Ubuntu 14.04
Following on from my last post, (ok following almost 12 months behind), I decided to try out running my own server for my freelance antics rather than use a managed host.
Part of me wishes I hadn’t as it’s a bit of a minefield. But I got through most things, and have automated deployments and a host of other shiny features us devs find desirable these days.
My big problem came when trying to send an email from a contact form to myself. Essentially, it just didn’t work. Google was little help too as a huge amount of “fixes” were listed ranging from using sSMTP – which I got semi working, only to then find it had been deprecated.
My previous attemps to get sendmail to work had been unsuccessful. I’m pretty sure it was something I’d done wrong but from messing around and it working, I can’t say what. Here though is what does work;
I edited /etc/hosts to include:
127.0.1.1 localhost localhost.localdomain sql.local hostname
Then, I set the sendmail_path in the php.ini to:
sendmail_path = /usr/sbin/sendmail -t -i
(Last time, I don’t think I included the flags!)
Then I ran sendmailconfig and blindly agreed to everything.
Hey presto, alakazam, abracadabra etc etc, it works. Just as I wanted it to. Win.
Much thanks has to be directed at this post as it gave me the answers, though I only followed the steps above.