How To Use Sender-Based Routing In Postfix With AWS SES

NOTE: This procedure requires Postfix version 2.7 or greater!
Create or edit the following three files:
/etc/postfix/main.cf
1 |
sender_dependent_default_transport_maps = hash:/etc/postfix/sender_dependent_default_transport_maps |
/etc/postfix/master.cf
1 2 |
aws-email unix - n n - - pipe flags=R user=mail argv=/opt/aws/bin/ses-send-email.pl -r -k /var/spool/mail/aws-credentials -e https://email.us-east-1.amazonaws.com -f ${sender} ${recipient} |
/etc/postfix/sender_dependent_default_transport_maps
yourName@gmail.com aws-email:
yourName@yourDomain.com aws-email:
Verify the credentials are in place and have the correct ownership and permissions:
12
chown mail:mail /var/spool/mail/aws-credentialschmod 600 /var/spool/mail/aws-credentials
Compile the new map and reload postfix.
1 2 |
chown mail:mail /var/spool/mail/aws-credentials chmod 600 /var/spool/mail/aws-credentials |
1 2 3 |
postmap /etc/postfix/sender_dependent_default_transport_maps postfix reload tail -f /var/log/maillog |
http://www.postfix.org/postconf.5.html#sender_dependent_default_transport_maps
http://www.kutukupret.com/2010/01/02/postfix-bind-sender-domain-to-dedicated-outgoing-ip-address/
Leave Your Comment
All fields marked with "*" are required.