I set up SSMTP with Gmail because I wanted to get mails for cron results.
I have these in /etc/ssmtp/ssmtp.conf:
root=<USER>gmail.com mailhub=smtp.gmail.com:587 #rewriteDomain= hostname=gmail.com UseTLS=YES UseSTARTTLS=YES AuthMethod=LOGIN AuthUser=<USER>gmail.com AuthPass=<SECRET> FromLineOverride=YES
Make sure this is only root-and-ssmtp-readable.
And /etc/ssmtp/revaliases:
root:<USER>gmail.com:smtp.gmail.com:587 livibetter:<USER>gmail.com:smtp.gmail.com:587
You can test with
echo mailbody | mail -v -s "mail subject" someoneexample.com echo mailbody | sendmail -v someoneexample.com
I dont have this mail command on my Gentoo, but it seems popular in every page I have read.
If you want to send a more complete test email via sendmail you can
echo -e "Subject: mail subject\nTo: someoneexample.com\n\nmailbody" | sendmail -v someoneexample.com
0 comments:
Post a Comment