Last active
September 20, 2024 09:23
-
-
Save kawaz/e80f3757e1607048da8bebe1dd4352f5 to your computer and use it in GitHub Desktop.
postfixからSESに雑にメールをリレーさせる設定テンプレ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ローカルで発生したメールを全部SESにリレーして送信する | |
sender_canonical_maps=regexp:/etc/postfix/sender_canonical_maps.regexp | |
sender_dependent_relayhost_maps=hash:/etc/postfix/sender_dependent_relayhost_maps regexp:/etc/postfix/sender_dependent_relayhost_maps.regexp | |
smtp_sasl_auth_enable=yes | |
smtp_sasl_password_maps=hash:/etc/postfix/smtp_sasl_password_maps regexp:/etc/postfix/smtp_sasl_password_maps.regexp | |
smtp_sasl_security_options=noanonymous | |
smtp_sender_dependent_authentication=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from が @example.com なメールはそのまま | |
/(.*@example\.com)$/ ${1} | |
# from が適当なホスト名の場合は元のホスト名情報を残しつつ @example.com に書き換える事でSESから送れるようにする | |
/(.+)@([^\.]+)$/ ${1}+${2}@example.com | |
/(.+)@(.+\.(local|localdomain|internal))$/ ${1}+${2}@example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from が example.com なメールはSESにリレーする | |
/@([a-z0-9\.-]+\.)?example\.com$/ [email-smtp.ap-northeast-1.amazonaws.com]:587 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SESリレー用のIAMユーザのパスワード | |
/@([a-z0-9\.-]+\.)?example\.com$/ AKXXXXX:PASSWORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment