How to send emails with Postfix and Amazon AWS SES on RHEL/CentOS 8

How to send emails with Postfix and Amazon AWS SES on RHEL/CentOS 8

To send emails with Postfix and Amazon AWS Simple Email Service (SES) on RHEL/CentOS 8, follow these steps:

  1. Install Postfix:
refe‮:ot r‬lautturi.com
sudo yum install postfix
  1. Configure Postfix to use Amazon SES as the SMTP server. Edit the /etc/postfix/main.cf configuration file, and add the following lines at the end:
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:
[email-smtp.us-east-1.amazonaws.com]:587 YOUR_AWS_ACCESS_KEY_ID:YOUR_AWS_SECRET_ACCESS_KEY

Replace YOUR_AWS_ACCESS_KEY_ID and YOUR_AWS_SECRET_ACCESS_KEY with your AWS access key ID and secret access key, respectively.

  1. Run the following command to create a hashed version of the sasl_passwd file:
sudo postmap /etc/postfix/sasl_passwd
  1. Restart Postfix to apply the changes:
sudo systemctl restart postfix
  1. Test the configuration by sending an email using the sendmail.
Created Time:2017-10-29 22:08:37  Author:lautturi