首先,我是 CentOS 7 新手。我在 CentOS 7 上运行电子邮件服务器,目前在 postfix 上设置 SMTPS 时遇到问题。顺便说一句,端口 993 上的 SSL imap 运行正常。端口 465 和 SMTPS 服务也已添加到防火墙中。
问题 # 1:运行 telnet localhost 465 的结果
sudo telnet localhost 465
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
问题 # 2:运行 sudo openssl s_client -connect mail.server.com:465 的结果
CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 247 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
这是 /etc/postfix/main.cf 下的配置
smtp_use_tls = yes
smtp_tls_key_file = /etc/pki/tls/private/server.com.key
smtp_tls_cert_file = /etc/pki/tls/certs/server.com.crt
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
并在 /etc/postfix/master.cf 下进行配置
smtp inet n - n - - smtpd
#smtp inet n - n - 1 postscreen
#smtpd pass - - n - - smtpd
#dnsblog unix - - n - 0 dnsblog
#tlsproxy unix - - n - 0 tlsproxy
#submission inet n - n - - smtpd
# -o syslog_name=postfix/submission
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=$mua_client_restrictions
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
# -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
smtps inet n - n - - smtpd
# -o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
我尝试过多种不同的方法在 Postfix 上设置 SMTPS,但都不起作用。有人能帮我吗?谢谢!