Amazon Simple Email Service also known Amazon SES evolved from the email platform that Amazon.com created to communicate with its own customers.

Amazon SES eliminates the complexity and expense of building an in-house email solution. You can use the Amazon SES API to integrate the functionality of Amazon SES directly into applications you develop. Or you can use the Amazon SES SMTP interface to send email through the third-party applications you already use, such as email clients, ticketing systems, autoresponders or in our case postfix.

In this tutorial i will show you how to configure postfix to work with Amazon SES SMTP servers.

Assumptions

You already have an AWS account. You are out of the Amazon SES Sandbox. You already verify the domain you going to use to send emails. You already have a Linux based server with postfix installed

Step 1 – Install needed packages

For Debian, Ubuntu, etc:

apt-get install libsasl2-modules

For CentOS, Fedora, RedHat:

yum install cyrus-sasl-plain

Step 2 – Edit postfix main file

vim /etc/postfix/main.cf

relayhost = email-smtp.eu-west-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

Change the relayhost depending on your zone

Step 3 – Create a sasl-passwords file

vim /etc/postfix/sasl-passwords

email-smtp.eu-west-1.amazonaws.com AWS_SES_USER_Access_Key_ID:AWS_SES_USER_Secret_Access_Key

Change the AWS SMTP server and key values as you needed

postmap hash:/etc/postfix/sasl-passwords

Step 4 – Edit postfix master file

vim /etc/postfix/master.cf

add or uncomment the following lines

amavis unix – – – – 2 smtp

-o smtp_tls_security_level=none

127.0.0.1:10025 inet n – – – – smtpd

-o smtp_tls_security_level=none

Step 5 – Restart postfix

systemctl postfix restart