How to configure AWS SES with Postfix MTA

www‮.‬lautturi.com
How to configure AWS SES with Postfix MTA

To configure the Amazon Web Services (AWS) Simple Email Service (SES) with Postfix Mail Transfer Agent (MTA), you will need to perform the following steps:

  1. Install and configure Postfix on your server. You can refer to the Postfix documentation for instructions on how to do this.

  2. Obtain the necessary AWS access keys to allow Postfix to connect to SES. You will need an AWS access key ID and secret access key.

  3. Modify the Postfix main configuration file, /etc/postfix/main.cf, to include the following lines:

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_passwd
  1. Create the /etc/postfix/sasl_passwd file and add the following line to it, replacing <access key ID> and <secret access key> with your own AWS access keys:
[email-smtp.us-east-1.amazonaws.com]:587 <access key ID>:<secret access key>
  1. Run the postmap command to create a hashed version of the sasl_passwd file:
postmap /etc/postfix/sasl_passwd
  1. Restart Postfix to apply the changes:
systemctl restart postfix
  1. Verify that Postfix is able to successfully send emails through SES by sending a test email.
Created Time:2017-10-28 21:39:00  Author:lautturi