ssmtp allow to have a minimalist smtp server to send email using a provider such as gmail
ssmtp has been deprecated and is no longer maintained on
debian-buster. source. The solution is to try
# The user that gets all the mails (UID < 1000, usually the admin) firstname.lastname@example.org # The mail server (where the mail is sent to), both port 465 or 587 should be acceptable # See also https://support.google.com/mail/answer/78799 mailhub=smtp.gmail.com:587 # The address where the mail appears to come from for user authentication. rewriteDomain=gmail.com # The full hostname. Must be correctly formed, fully qualified domain name or GMail will reject connection. hostname=yourlocalhost.yourlocaldomain.tld # Use SSL/TLS before starting negotiation UseTLS=Yes UseSTARTTLS=Yes # Username/Password AuthUser=username AuthPass=password AuthMethod=LOGIN # Email 'From header's can override the default domain? FromLineOverride=yes
echo -n 'Subject: test\n\nTesting ssmtp' | sendmail -v email@example.com
To:firstname.lastname@example.org From:email@example.com Subject: Test This is a test mail.
sendmail -t < mail.txt