Help getting msmtp to work with google apps and Wordpress.
echo 'test' | msmtp
it also works with some other addresses, but not with any of the temporary ones I tried out.
Anyway, here are the relevant conf files
account gmail
host smtp.gmail.com
port 587
protocol smtp
auth on
from xxx@infocalypse-net.info
user xxx@infocalypse-net.info
password xxxxxx
tls on
tls_starttls on
tls_trust_file /usr/share/ca-certificates/mozilla/Thawte_Premium_Server_CA.crt
account default : gmail
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "/usr/bin/msmtp -t"
So shouldn't wordpress now use that to send emails? I can send to some addresses with the manual command, so shouldn't it work? Well it doesn't. Wordpress doesn't do anything, and all of the various plugins I tried don't work either.
Edit:
I tried changing the flags in my php.ini
"/usr/bin/msmtp -t -i" doesn't work either, nor do any of the other ones I've tried.
According to the msmtp docs, 'sendmail' mode is enabled by default, so it should be compatible. I'm just not sure if I need to do something special to make it work.
4 Replies
If you really want to use smtp on an external server for PHP you should consider using
msmtp is configured to only allow read/write permissions for the user who owns the conf file, ~/.msmtprc
If you want apache to be able to access the conf file, you need to copy ~/.msmtprc over to /etc and give the user running apache read access. Making sure to rm the file in ~/ once you've done that.
Couldn't be any simpler, yet nowhere I looked told me this.