后缀 – 通过端口465(smtps)连接到smtpd的问题

我有一个后缀和Dovecot SSL证书设置。 我能够使用TLS连接从Dovecot读取邮件,但是我无法使用smtps发送任何邮件。 我只能通过smtp(端口25)。 当我尝试通过smtps发送它连接到后缀,但它只是挂起,直到它超时。 什么可能导致这个?

这些是我在main.cf文件中的postfix的smtpd设置:

smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination smtpd_tls_auth_only = yes smtp_use_tls = yes smtpd_use_tls = yes smtp_tls_note_starttls_offer = yes smtpd_tls_cert_file=/opt/ssl.crt smtpd_tls_key_file=/opt/ssl.key smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache 

您需要取消注释/etc/postfix/master.cf中的smtps行

你现在得到的样子如下所示。 尝试取消注释前两行并重新启动Postfix。 您应该看到Postfix现在正在侦听端口465.您可能还需要在防火墙上打开该端口。

 #smtps inet n - n - - smtpd # -o smtpd_tls_wrappermode=yes # -o smtpd_sasl_auth_enable=yes # -o smtpd_client_restrictions=permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING 

如果SSL证书有些奇怪的话,我会看到类似的行为。 仔细检查Postfix设置对SSL证书是否正确。

编辑:对于初学者:Postfix是否有权限访问/opt/ssl.*文件?

你可以尝试注释掉这些行,然后重新启动Postfix。

 tls_random_source = dev:/dev/urandom smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache