SSMTP

From Indie IT Wiki
Jump to: navigation, search

HOWTO: Amazon SES

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

mailhub=email-smtp.eu-west-1.amazonaws.com:465
Hostname=www.example.com
AuthUser=AAAAAAAAAAAETRLB2UWQ
AuthPass=[password from AWS]
FromLineOverride=yes
UseTLS=yes
UseSTARTTLS=YES

Also, update the /etc/ssmtp/revaliases.

root:user@example.com:email-smtp.eu-west-1.amazonaws.com:465

Thanks - http://edoceo.com/howto/ssmtp

HOWTO: Set Up SSMTP On Ubuntu Server

sudo apt-get install -y ssmtp
sudo nano /etc/ssmtp/ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=me@mypersonalemail.co.uk

# 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=server1.domain.com:25

# Where will the mail seem to come from?
rewriteDomain=domain.com

# The full hostname
hostname=server2@domain.com

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
# FromLineOverride=YES

AuthUser=myuser@mydomain.com
AuthPass=MyPaSsWoRd
# useSTARTTLS=YES
sudo nano /etc/ssmtp/revaliases
# sSMTP aliases
# 
# Format:       local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
root:server2@domain.com:server1.domain.com:25

http://www.havetheknowhow.com/Configure-the-server/Install-ssmtp.html

Testing

http://askubuntu.com/questions/643873/how-to-get-ssmtp-to-map-local-user-to-email-address-for-the-to-field

echo "message" |mailx -s "test" root
echo "message" |mailx -s "test" user@domain.com

HOWTO: Create Aliases

The software SSMTP does not use the traditional file /etc/mail/aliases, but instead uses entries in the file /etc/mailrc.

You will needto install the package bsd-mailx first and make sure the binary 'mail' points to 'mailx'.

sudo apt-get install bsd-mailx
sudo nano /etc/mail.rc

set ask askcc append dot save crt
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via Delivered-To
alias root root<me@mydomain.com>
alias itsupport user@domain1.com,joe.smith@domain2.co.uk,joebloggs@domain3.com

Thanks - http://possiblelossofprecision.net/?p=591