All Linux HowTo's Security HowTo's

Configure Postfix to relay SMTP to Amazons AWS SES SMTP gateway

We start from a working Postfix configuration. This article will simply show you what needs to be changed in order to use the Amazon SES email relay. In this example we’re using the “email-smtp.us-east-1.amazonaws.com” SMTP relay from Amazon. you should use the one allocated to you. See Amazon’s documentation here.

TIP: SES is in “sandbox” mode until you lodge a support request to have the limit increased. Do this before you start forwarding your email through SES.

yum install mailx cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5

Added the following to “/etc/postfix/main.cf”:

# AGIX
relayhost = email-smtp.us-east-1.amazonaws.com:587
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl-passwords
smtp_use_tls = yes
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
smtp_sasl_mechanism_filter = PLAIN LOGIN

Added the following to “/etc/postfix/sasl-passwords” on one line. Make sure to replace the [username] and [password] with yours. Remove the [ and ] characters from my example:

email-smtp.us-east-1.amazonaws.com [username]:[password]

Then run the following:

postmap hash:/etc/postfix/sasl-passwords

Then restarted postfix:

service postfix restart

Similar Posts: