Skip to content

Instantly share code, notes, and snippets.

@kawaz
Last active September 21, 2024 03: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からAmazon 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
# sender_canonical_maps sender (envelope-from)
#
# sender
# sender validation
# sender @example.com =
/(.*@example\.com)$/ ${1}
# sender @example.com
/(.+)@([^\.]+)$/ ${1}+${2}@example.com
# sender @example.com
/(.+)@(.+\.(local|localdomain|internal))$/ ${1}+${2}@example.com
# sender @example.com
#/(.+)@(.+)$/ ${1}+${2}@example.com
# sender_dependent_relayhost_maps sender
#
#
# validationsenderSES
# 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