PostfixはAUTHコマンドを発行しません

PostfixはAUTHコマンドを発行しません

サーバーから Postfix 経由でメールを送信しようとしましたが、うまくいきません。リレー ホストとして外部 SMTP サーバーを使用しています。次の部分が該当します/etc/postfix/main.cf:

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
relayhost = [mail.myISP.nl]:submission
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
debug_peer_list=mail.myISP.nl
debug_peer_level=5

libsasl2-2libsasl2-modulesおよびをインストールしましたsasl2-bin。 では/etc/postfix/sasl_password、有効な資格情報を入力しました:

[mail.myISP.nl]:587     myuserid:mypassword

その後、テキスト ファイルをファイルに変換するコマンドを実行しました.db

postmap /etc/postfix/sasl_password

Postfixの設定を再読み込みしました:

sudo systemctl reload postfix

しかし、実際にはメールは送信されません。次のコマンドで TCP ダンプを実行しました。

echo "This is a test" | mail -s "Testing" [email protected]

その結果、リモート サーバーとのやり取りは次のようになりました。

(S) srv17610.myISP.nl ESMTP Exim 4.86.2 Wed, 28 Dec 2016 11:06:24 +0100
(C) EHLO hostname
(S) 250-srv17610.myISP.nl Hello my.canonical.name.nl [xxx.xxx.xxx.xxx]
(S) 250-SIZE 20971520
(S) 250-8BITMIME
(S) 250-PIPELINING
(S) 250-AUTH PLAIN LOGIN
(S) 250-STARTTLS
(S) 250 HELP
(C) MAIL FROM:<[email protected]> SIZE=310
(C) RCPT TO:<[email protected]>
(C) DATA
(S) 250 OK
(S) 550 relay not permitted, authentication required
(S) 503-All RCPT commands were rejected with this error:
(S) 503-relay not permitted, authentication required
(S) 503 Valid RCPT command must precede DATA
(C) RSET
(C) QUIT
(S) 250 Reset OK
(S) 221 srv17610.myISP.nl closing 

(C) は Postfix、(S) はリモート サーバーです。AUTH コマンドが発行されず、認証情報が提供されないため、メールが拒否されていることがわかります。単にメールが/var/log/mail.log送信されたと表示されます。何が問題なのでしょうか?

答え1

設定は正当に見えますが、postfix では smtp_sasl_password_maps ファイルをクリアテキストではなく最適化された方法で実際に保存する必要があります。

そのようなファイルがない場合

次のコマンドを実行します:

ポストマップ /etc/postfix/sasl_password

sasl_password.dbを生成します

サービス pos​​tfix リロード

変更を適用する

関連情報