Getting email to work with smartd, ssmtp, and picky email providers

My server is running debian jessie.
Recently I had been messing around with different mailing setups, which resulted in total breakage of email sending, as sometimes required by some software, usually via sendmail.

First of all I purged all packages, like dovecot and exim4, and always performed an
“apt-get –purge autoremove” afterwards.
Then I had to go through all the leftover configuration & modifications in /etc. There was a lot of it, even after purging the packages.

With a hopefully clean system, install ssmtp and mailutils: apt-get install ssmtp mailutils.

Configuration for Gmail:

root=someone@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=nn.nn.nn.nn (my IP)
hostname=nn.nn.nn.nn
FromLineOverride=YES
UseTLS=YES
UseSTARTTLS=YES
AuthUser=someone@gmail.com
AuthPass=verysecret
AuthMethod=LOGIN

Configuration for other Picky Email Provider

I had to

# /etc/ssmtp/ssmtp.conf:
root=mailaddress@posteo.de
normaluser=mailaddress@posteo.de
# /etc/ssmtp/revaliases:
root:mailaddress@posteo.de:smtp.posteo.de:587
username:mailaddress@posteo.de:smtp.posteo.de:587

…maybe that wasn’t really necessary, but often it seems to be important that th from addresses matches that of the actual email account used.

Other things

Source


Dec 10th, 2017