
stunnel
CentOS 7サーバーにインストールしようとしていますが、次のエラーが発生します。不明なTCPサービス間違い。 stunnel
インストールを完了するには、このエラーをどのように解決する必要がありますか?
stunnel
次のようにインストールしてテストしました。
# yum install stunnel
# yum install telnet
# vi /etc/stunnel/stunnel.conf (creates new file)
以下を追加してください。
client=yes
[rev-smtps]
accept=127.0.0.1:2525
connect=the.mail.server.url
Esc :wq
その後、コマンドラインに戻ります。
# stunnel &
# telnet 127.0.0.1 2525
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
[1]+ Done stunnel
私はこれをstunnelがリモートメールサーバーに接続していないと解釈します。チュートリアルでは、次のような結果を期待する必要があると述べています。:
[root@dev xinetd.d]# telnet localhost 2525
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 smtp104.sbc.mail.re3.yahoo.com ESMTP
EHLO
250-smtp104.sbc.mail.re3.yahoo.com
250-AUTH LOGIN PLAIN XYMCOOKIE
250-PIPELINING
250 8BITMIME
quit
Connection closed by foreign host.
上記の設定でthe.mail.server.url
私のMS Outlookで動作する正確なURLは、同じメールサーバーに接続してsmtpsとimapメールを取得することです。
また、これらのテストの時点で、この開発サーバーの一時的なファイアウォール規則は次のとおりです。
[root@localhost stunnel]# firewall-cmd --list-all
public (default, active)
interfaces: ens7 eth0
sources:
services: dhcpv6-client http imaps smtp ssh
ports: 8080/tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
でsmtp.xml
指定されたfilewalld構成ファイルにはファイルがないように見えます。port 465
smtp
smtps.xml
journalctl
実行後すぐに入力すると、telnet localhost 2525
ログの末尾に以下が追加されます。
Oct 19 15:56:40 localhost.localdomain stunnel[6657]: LOG5[6657:140496905537280]: Service [rev-smtps] accepted connection from 127.0.0.1:43872
Oct 19 15:56:40 localhost.localdomain stunnel[6657]: LOG3[6657:140496905537280]: Unknown TCP service 'the.mail.server.url'
Oct 19 15:56:40 localhost.localdomain stunnel[6657]: LOG3[6657:140496905537280]: No host resolved
Oct 19 15:56:40 localhost.localdomain stunnel[6657]: LOG5[6657:140496905537280]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
それでは、どのように機能するのかどうかを確認できますかstunnel
?
答え1
client=yes [rev-smtps] accept=127.0.0.1:2525 connect=the.mail.server.url
stunnel
どのポートに接続する必要があるかを知らせることを忘れた可能性はありますか?
connect=mail.server.url:port
正しい構文でなければなりません。