Skip to content

Instantly share code, notes, and snippets.

@kawaz
Last active September 20, 2024 09:23
Show Gist options
  • Save kawaz/e80f3757e1607048da8bebe1dd4352f5 to your computer and use it in GitHub Desktop.
Save kawaz/e80f3757e1607048da8bebe1dd4352f5 to your computer and use it in GitHub Desktop.
postfixからSESに雑にメールをリレーさせる設定テンプレ
# ローカルで発生したメールを全部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
# from @example.com
/(.*@example\.com)$/ ${1}
# from @example.com SES
/(.+)@([^\.]+)$/ ${1}+${2}@example.com
/(.+)@(.+\.(local|localdomain|internal))$/ ${1}+${2}@example.com
# from example.com SES
/@([a-z0-9\.-]+\.)?example\.com$/ [email-smtp.ap-northeast-1.amazonaws.com]:587
# SESIAM
/@([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