インターネットに面した MX サーバーがあり、すべてのユーザーが送信接続を認証して、ポート 587 経由でメールを送信します。この MX サーバーは、ドメインの受信メールを内部の postfix smtp サーバーにルーティングし、メールをローカルの imap サーバーに配信します。
内部 postfix smtp サーバーは LDAP alias_maps = ldap:/etc/postfix/ldap-aliases.cf を使用して、ユーザーのメールボックスが存在する imap サーバーを検索します。
後置オプションがあります... マップできる reject_sender_login_mismatch... smtpd_sender_login_maps = ldap:/etc/postfix/smtpd_sender_login.cf
ただし、次のエラーが表示されます
Jul 4 11:23:26 smtp-1.domain1.com postfix/smtpd[31530]: 警告: 制限 `reject_authenticated_sender_login_mismatch' は無視されました: SASL サポートなし
内部 postfix smtp サーバーに対してユーザー認証を行うことはありません。MX サーバーからメールをルーティングするだけです。「SASLサポートなし」という警告が表示される理由は、MXサーバーによって処理されるため、postfixが認証を処理しないためだと思います。
postconf -n
alias_database = hash:/etc/aliases
alias_maps = ldap:/etc/postfix/ldap-aliases.cf, hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 51200000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mx3.$mydomain, mx1.$mydomain, mx2.$mydomain
mydomain = domain1.com
myhostname = smtp-1.domain1.com
mynetworks = xxx.xxx.192.0/21, xxx.62.52.0/22, 10.0.0.0/8, xxx.16.0.0/12, xxx.168.0.0/16
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_sender_login_maps = ldap:/etc/postfix/ldap-senders.cf
smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch
unknown_local_recipient_reject_code = 550
ただし、別の設定で「smtpd_sender_restrictions = reject_unverified_sender」
「envelope From フィールド」に無効な偽造アドレスが含まれている場合、次のログが記録されます。これは、未知の電子メール アドレスが偽造されるのを防ぐのに最適ですが、既知の電子メール アドレスで偽造されている場合は役に立ちません。
NOQUEUE: 拒否: mx.domain1.com[xxx.xxx.192.130] からの RCPT: 450 4.1.7: 送信者アドレスが拒否されました: 未確認のアドレス: 不明なユーザー: "hejem"; from= to= proto=ESMTP helo=
-bash-4.1$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = ldap:/etc/postfix/ldap-aliases.cf, hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 51200000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mx3.$mydomain, mx1.$mydomain, mx2.$mydomain
mydomain = domain1.com
myhostname = smtp-1.domain1.com
mynetworks = xxx.xxx.xxx.0/21, xxx.xxx.xxx.0/22, xxx.0.0.0/xxx, xxx.xxx.0.0/12, xxx.xxx.0.0/16
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_sender_restrictions = reject_unverified_sender"
私が達成したいのは、「エンベロープ From フィールド」をチェックして、送信ユーザーのユーザー名を認識し、一致しない場合は LDAP で割り当てられた「From」エイリアスを検索することで、偽装されていないことを確認するためのローカル内部ポストフィックスです。再度スプーフィングし、メールを拒否します。
postfix でこのチェックを実装する方法について何かアドバイスはありますか?
ありがとう