Installation

Very easy, ours looks like:

[ebuild  N     ] mail-mta/ssmtp-2.64-r2  USE="gnutls ipv6 mta ssl"

Configuring ssmtp

Here is an annotated /etc/ssmtp/ssmtp.conf file, suggestions inside [square brackets].

# Get enhanced (*really* enhanced) debugging information in the logs
# If you want to have debugging of the config file parsing, move this option
# to the top of the config file and uncomment
# Debug=YES

# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=[enter a valid email address]

# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=[your smtp server]

# Example for SMTP port number 2525
# mailhub=mail.your.domain:2525
# Example for SMTP port number 25 (Standard/RFC)
# mailhub=mail.your.domain        
# Example for SSL encrypted connection
# mailhub=mail.your.domain:465

# Where will the mail seem to come from?
# rewriteDomain=[a different domain here, if needed ]

# The full hostname, should auto-detect
# hostname=[ enter the hostname here, set rDNS ]

# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
# Enable if you trust your users (ha!)
# FromLineOverride=YES

# If you have to login set these:
AuthUser=[ the username for the smtp server]
AuthPass=[ the password for the smtp server]

# Use SSL/TLS to send secure messages to server.
#UseTLS=YES

# Use SSL/TLS certificate to authenticate against smtp host.
#UseTLSCert=YES

# Use this RSA certificate.
#TLSCert=/etc/ssl/certs/ssmtp.pem

SSMTP Sending via GoDaddy Hosted Exchange

If you are using GoDaddy Hosted Exchange then you can use this configuration.

# For Exchange 2007
mailhub=smtp.ex1.secureserver.net:465
# For Exchange 2010 (pick one)
# mailhub=smtp.ex2.secureserver.net:587
# mailhub=smtp.ex3.secureserver.net:587
mailhub=smtp.ex4.secureserver.net:587

FromLineOverride=yes
UseSTARTTLS=yes
UseTLS=yes

Authuser=
AuthPass=

SSMTP on Amazon EC2/SES

When using Amazon SES collect the information from the SES SMTP settings page.

# debug=yes

mailhub=email-smtp.us-east-1.amazonaws.com:465

Hostname=www.example.com
AuthUser=AAAAAAAAAAAETRLB2UWQ
AuthPass=[password from AWS]

FromLineOverride=yes
UseTLS=yes

Also, update the /etc/ssmtp/revaliases.

root:user@example.com:email-smtp.us-east-1.amazonaws.com:465

SSMTP via Gmail

This shows how to configure ssmtp to relay messages out via Google Mail accounts. Replace $mail with your full email address and $pass with your password.

root=$mail
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587

# Debug=Yes

FromLineOverride=YES

AuthUser=$mail
AuthPass=$pass
UseSTARTTLS=YES
UseTLS=YES