pinkeen.postfix-relay
以下のテキストを日本語に翻訳しました。
Postfixをインストールして、メールをMailgun、Mailchimp、SendGridなどの外部サービスに中継するように設定します。
私見ですが、アプリから直接APIやSMTPを使うよりも、ローカルのPostfixをスプールとして使用する方が通常は良いと思います。ただし、状況によって異なります。
現在、サポートされているのは1つの中継のみですが、Postfixはenvelope from
ホストに基づいてメールをルーティングできるため、適応は簡単だと思われます。
変数:
postfix_relay_host
postfix_relay_username
postfix_relay_password
postfix_relay_port
複数ホストのメールルーティングノート
main.cf
に次のように設定します:sender_dependent_relayhost_maps = hash:/etc/postfix/relayhostsby
/etc/postfix/relayhostsby
に記述します:
@fromhost1 [someotherextrnalservice]
@fromhost2 [smtp.mandrillapp.com]:587
@fromhost3 [smtp.mandrillapp.com]:587
/etc/postfix/sasl_passwd
に記述します:
@fromhost1 hostuser:hostpass
@fromhost2 mandrilluser:mandrillpass
@fromhost2 mandrilluser:mandrillpass
おそらくいくつかの問題を解決するための他のオプション:
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhostsby
smtp_sender_dependent_authentication = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_auth_enable = yes
smtp_use_tls=yes
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_security_level = may
smtpd_tls_received_header = yes
tls_random_source = dev:/dev/urandom
smtpd_tls_security_level = may
smtp_use_tls = yes
smtp_sasl_security_options = noanonymous
簡単に理解できるように意訳していますので、ご確認ください。