CLIENTパッケージングモード(ポートsmtps / 465)は実装されていません。

CLIENTパッケージングモード(ポートsmtps / 465)は実装されていません。

CentOS 7サーバーの中継ホストから電子メールを送信するためにpostfixを使用しようとすると、次のエラーが発生します。

Oct 19 19:53:08 localhost postfix/pickup[7174]: 64DAF1A53CB: uid=1002 from=<me>
Oct 19 19:53:08 localhost postfix/cleanup[7184]: 64DAF1A53CB: message-id=<[email protected]>
Oct 19 19:53:08 localhost postfix/qmgr[7175]: 64DAF1A53CB: from=<[email protected]>, size=447, nrcpt=1 (queue active)
Oct 19 19:53:08 localhost postfix/smtp[7177]: CLIENT wrappermode (port smtps/465) is unimplemented
Oct 19 19:53:08 localhost postfix/smtp[7177]: instead, send to (port submission/587) with STARTTLS
Oct 19 19:53:18 localhost postfix/smtp[7177]: 64DAF1A53CB: to=<[email protected]>, relay=emailserver.com[ip.of.email.server]:465, delay=10, delays=0.06/0/10/0, dsn=d.s.n, status=deferred (lost connection with emailserver.com[ip.of.email.server] while receiving the initial server greeting)  

このために私がとったアクションは次のとおりです。

# yum -y install postfix cyrus-sasl-plain mailx
# systemctl restart postfix
# systemctl enable postfix
# vi /etc/postfix/main.cf
//Add the following at THE VERY END OF THE FILE:
myhostname = mydomain.com
relayhost = [emailserver.com]:465
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
// save and close, then create the following new file:
# vi /etc/postfix/sasl_passwd
// add the following one line:
[emailserver.com]:465 username:password
// save and close the file
// create a postfix lookup table by running the following command:
# postmap /etc/postfix/sasl_passwd
// restrict access to the file:
# chown root:postfix /etc/postfix/sasl_passwd*
# chmod 640 /etc/postfix/sasl_passwd*
# systemctl reload postfix

その後、CentOSに「me」という新しいユーザーを設定し、次のコマンドを入力しました。

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

上記のコマンドからport 465に変更すると、そのコマンドを使用してメッセージを正常に送信port 587できます。echoしかし、emailserver.comカスタマーサポートラインではと言われており、port 465これまでそうでした。ここでの問題は、SSLが機能しないことです。送信するにはどうすればよいですか?SSL onlyport 587SSL disabledSSL SMTPport 465

CentOS 7開発サーバーはport 25無効な住宅用ケーブルモデムの背後にあるため、リレーホストを使用する必要があります。また、これを使用してport 465SSL接続を保護したいと思います。電子メールはSSL経由で送信する必要があります。

完全な/etc/postfix/main.cfファイル内容は次のとおりです。

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = localhost
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES

#####################################################################
### Everything below was added to set up relayhost for smtp
#####################################################################

myhostname = mydomain.com

relayhost = [emailserver.com]:465
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous  

port 465注:Firewalldはsmtp.xmlファイルをsmtp用に設定しましたが、サービスをport 25作成していません。smtps私はこれが関連性がないと思いますが、もしそうなら共有したいと思いました。

ベストアンサー1

この記事の公開時に上記の内容をテストしたサーバーには、自己署名SSL証明書はありません。 (当時は個人証明書が使用されました。)リモートメールサーバーに署名されたSSL証明書が必要だったため、OPからの接続要求を拒否してこの投稿を発生させたエラーが発生しました。

この場合、ソリューションには署名付きSSL証明書の使用が含まれます。ただし、このエラーは、信頼できる署名されていない証明書を許可するメールサーバーを使用するか、暗号化されていない要求を送信して解決することができます。

おすすめ記事