SMTP 错误 - Dovecot/Postfix

SMTP 错误 - Dovecot/Postfix

Dovecot 和 Postfix 都运行良好。尤其适用于 Win 8+ 和 Mac OS 10.10+ 以及 iOS 8+ 机器。

但尝试从 10.9 Mavericks Mac 进行连接时却出现了奇怪的情况......

这是我的 main.cf

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

readme_directory = no

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mydestination =
mailbox_size_limit = 5120000000000000
message_size_limit = 30720000
recipient_delimiter =
inet_interfaces = all
myorigin = example.ddns.net
inet_protocols = all

# specify SMTP relay host 
relayhost = [myhost]:587

##### TLS parameters ######
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


###### SASL Auth ######
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
   permit_sasl_authenticated,
   permit_mynetworks,
   check_relay_domains


###### Use Dovecot LMTP Service to deliver Mails to Dovecot ######
virtual_transport = lmtp:unix:private/dovecot-lmtp


##### Only allow mail transport if client is authenticated or in own network (PHP Scripts, ...) ######
#smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination


###### MySQL Connection ######

virtual_alias_maps = mysql:/etc/postfix/virtual/mysql-aliases.cf
virtual_mailbox_maps = mysql:/etc/postfix/virtual/mysql-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/virtual/mysql-domains.cf
local_recipient_maps = $virtual_mailbox_maps


# enable SASL authentication 
smtp_sasl_auth_enable = yes
# disallow methods that allow anonymous authentication. 
smtp_sasl_security_options = noanonymous
# where to find sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

日志中的消息指出:

    Jun 16 11:36:43 example postfix/smtpd[8038]: SSL_accept error from unknown[xxx]: lost connection
Jun 16 11:36:43 example postfix/smtpd[8038]: lost connection after STARTTLS from unknown[xxx]
Jun 16 11:36:43 example postfix/smtpd[8038]: disconnect from unknown[xxx4]
Jun 16 11:36:47 example postfix/submission/smtpd[8022]: auto_clnt_close: disconnect private/tlsmgr stream

然而我尝试在 465 和 587 上使用 SSL 进行连接,以及在 25 上使用非 SSL 进行连接。运行最新软件版本的其他客户端运行正常。

答案1

感谢@ychaouche,我找到了解决方案。

客户端不接受证书。这意味着不允许 SSL 传输。重新启动客户端邮件应用程序并信任此不受信任的 openssl 证书后,一切都按预期运行!

谢谢!

相关内容