2

/etc/postfix/main.cf で次のようにリレー ホストを使用するために postfix を構成しようとしています。

relayhost = [mailtrap.io]:2525
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

telnet localhost 25Postfixログを介して電子メールを送信した後、次のように表示されます:

Mar 20 10:49:52 hydra postfix/smtpd[19898]: connect from localhost[127.0.0.1]
Mar 20 10:49:52 hydra postfix/smtpd[19898]: improper command pipelining after MAIL from localhost[127.0.0.1]
Mar 20 10:49:52 hydra postfix/smtpd[19898]: 5F9BC2C30A1: client=localhost[127.0.0.1]
Mar 20 10:49:52 hydra postfix/cleanup[19902]: 5F9BC2C30A1: message-id=<20120320084952.5F9BC2C30A1@hydra>
Mar 20 10:49:52 hydra postfix/qmgr[19890]: 5F9BC2C30A1: from=<a@b.com>, size=290, nrcpt=1 (queue active)
Mar 20 10:49:52 hydra postfix/smtp[19904]: warning: SASL authentication failure: No worthy mechs found
Mar 20 10:49:52 hydra postfix/smtp[19904]: 5F9BC2C30A1: to=<c@d.com>, relay=mailtrap.io[176.9.59.220]:2525, delay=0.32, delays=0.19/0.01/0.13/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server mailtrap.io[176.9.59.220]: no mechanism available)

SMTP サーバー (リレーホスト) ログ:

>>> EHLO hydra
250-Ok Helo 213.160.145.74, Mailtrap SMTP Server
250-AUTH PLAIN
250-NO-SOLICITING
250 SIZE 20000000
>>> QUIT
221 Ok

修正方法はありますか?

OS: Ubuntu.

4

2 に答える 2

5

この問題は、デフォルトの postfix SMTP セキュリティ オプションが暗号化されていないパスワードを持つことを許可していないという事実によって引き起こされます。

この問題に関する Postfix ドキュメント

この場合の正しい構成は次のようになります。

relayhost = [mailtrap.io]:2525
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
于 2012-03-23T15:17:52.747 に答える
3

構成ファイルでは、おそらく設定する必要があります( http://mhawthorne.net/posts/postfix-configuring-gmail-as-relay.htmlsmtp_use_tls = yes の構成を参照してください) 。

上記に加えて、次のものlibsasl2-modulesがインストールされていることを確認する必要がありました。

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

apt-get インストール libsasl2-modules

/etc/init.d/postfix 再起動

于 2012-12-26T17:26:34.303 に答える