Amazon SES Postfix configuration
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.
- 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
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
Change the AWS SMTP server and key values as you needed
Step 4 – Edit postfix master file
add or uncomment the following lines
amavis unix – – – – 2 smtp
127.0.0.1:10025 inet n – – – – smtpd
Step 5 – Restart postfix
systemctl postfix restart
This article is free and open source. You have permission to republish it under a Creative Commons license with attribution to the author and Teknixx.com