Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hernad/f3031c05b06649b2bc3d6d59d3b673e8 to your computer and use it in GitHub Desktop.
Save hernad/f3031c05b06649b2bc3d6d59d3b673e8 to your computer and use it in GitHub Desktop.
Steps to switch from sendmail to postfix on Amazon Linux and enable using SES
yum install postfix
alternatives --set mta /usr/sbin/sendmail.postfix
service sendmail stop
chkconfig sendmail off
# https://github.com/mozilla/identity-ops/blob/master/chef/cookbooks/persona-common/recipes/postfix.rb
HISTCONTROL=ignoreboth
USERNAME="usernamegoeshere"
PASSWORD="passwordgoeshere"
SMTP_HOST="email-smtp.eu-west-1.amazonaws.com"
echo "$SMTP_HOST:25 $USERNAME:$PASSWORD" > /etc/postfix/sasl_passwd
/usr/sbin/postmap /etc/postfix/sasl_passwd
cat << 'EOF' >> /etc/postfix/main.cf
relayhost = $SMTP_HOST:25
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
EOF
service postfix start
chkconfig postfix on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment