You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Postfix与Dovecot出现'Connection closed by foreign host'提示及SASL认证机制缺失问题求助

Postfix与Dovecot出现'Connection closed by foreign host'提示及SASL认证机制缺失问题求助

各位大佬好,我目前在配置Postfix和Dovecot邮件系统时遇到了问题,具体情况如下:

系统日志信息

2024-02-07T10:44:27.271322+00:00 ubuntuserver postfix/postfix-script[23192]: starting the Postfix mail system
2024-02-07T10:44:27.277625+00:00 ubuntuserver postfix/master[23194]: daemon started -- version 3.8.1, configuration /etc/postfix
2024-02-07T10:44:40.243297+00:00 ubuntuserver postfix/postfix-script[23362]: stopping the Postfix mail system
2024-02-07T10:44:40.247092+00:00 ubuntuserver postfix/master[23194]: terminating on signal 15
2024-02-07T10:46:34.261781+00:00 ubuntuserver postfix/postfix-script[23909]: starting the Postfix mail system
2024-02-07T10:46:34.265893+00:00 ubuntuserver postfix/master[23911]: daemon started -- version 3.8.1, configuration /etc/postfix
2024-02-07T11:26:02.703172+00:00 ubuntuserver postfix/postfix-script[24238]: stopping the Postfix mail system
2024-02-07T11:26:02.704681+00:00 ubuntuserver postfix/master[23911]: terminating on signal 15
2024-02-07T11:26:19.250830+00:00 ubuntuserver postfix/postfix-script[24712]: starting the Postfix mail system
2024-02-07T11:26:19.254177+00:00 ubuntuserver postfix/master[24714]: daemon started -- version 3.8.1, configuration /etc/postfix
2024-02-07T11:34:29.882247+00:00 ubuntuserver postfix/postfix-script[24772]: stopping the Postfix mail system
2024-02-07T11:34:29.884062+00:00 ubuntuserver postfix/master[24714]: terminating on signal 15
2024-02-07T11:34:30.315051+00:00 ubuntuserver postfix/postfix-script[25096]: starting the Postfix mail system
2024-02-07T11:34:30.318434+00:00 ubuntuserver postfix/master[25098]: daemon started -- version 3.8.1, configuration /etc/postfix
2024-02-07T11:35:09.435123+00:00 ubuntuserver dovecot: master: Dovecot v2.3.20 (80a5ac675d) starting up without any protocols (core dumps disabled)
2024-02-07T11:36:24.099861+00:00 ubuntuserver dovecot: master: Dovecot v2.3.20 (80a5ac675d) starting up without any protocols (core dumps disabled)
2024-02-07T11:36:27.211101+00:00 ubuntuserver postfix/postfix-script[1477]: starting the Postfix mail system
2024-02-07T11:36:27.225443+00:00 ubuntuserver postfix/master[1479]: daemon started -- version 3.8.1, configuration /etc/postfix
2024-02-07T11:40:17.812935+00:00 ubuntuserver dovecot: master: Warning: Killed with signal 15 (by pid=4133 uid=0 code=kill)
2024-02-07T11:40:18.972184+00:00 ubuntuserver dovecot: master: Dovecot v2.3.20 (80a5ac675d) starting up without any protocols (core dumps disabled)
2024-02-07T11:41:22.754295+00:00 ubuntuserver postfix/smtpd[4165]: connect from localhost[127.0.0.1]
2024-02-07T11:41:22.767707+00:00 ubuntuserver postfix/smtpd[4165]: fatal: no SASL authentication mechanisms
2024-02-07T11:41:23.770224+00:00 ubuntuserver postfix/master[1479]: warning: process /usr/lib/postfix/sbin/smtpd pid 4165 exit status 1
2024-02-07T11:41:23.770586+00:00 ubuntuserver postfix/master[1479]: warning: /usr/lib/postfix/sbin/smtpd: bad command startup -- throttling
2024-02-07T11:42:41.626555+00:00 ubuntuserver postfix/smtpd[4172]: connect from ubunturealm[192.168.1.16]
2024-02-07T11:42:41.631803+00:00 ubuntuserver postfix/smtpd[4172]: fatal: no SASL authentication mechanisms
2024-02-07T11:42:42.634696+00:00 ubuntuserver postfix/master[1479]: warning: process /usr/lib/postfix/sbin/smtpd pid 4172 exit status 1
2024-02-07T11:42:42.635251+00:00 ubuntuserver postfix/master[1479]: warning: /usr/lib/postfix/sbin/smtpd: bad command startup -- throttling
2024-02-07T11:41:22.767707+00:00 ubuntuserver postfix/smtpd[4165]: fatal: no SASL authentication mechanisms
2024-02-07T11:42:41.631803+00:00 ubuntuserver postfix/smtpd[4172]: fatal: no SASL authentication mechanisms
2024-02-07T11:55:48.403076+00:00 ubuntuserver postfix/smtpd[6067]: fatal: no SASL authentication mechanisms

Postfix主配置文件(main.cf)

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.

#myorigin = /etc/mailname

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

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on
# fresh installs.
compatibility_level = 3.6

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/server.crt
smtpd_tls_key_file = /etc/ssl/private/server.key
smtpd_tls_security_level = may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
defer_unauth_destination

myhostname = ubuntumailsystem
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = ubuntuserver.home, ubuntumailsystem, ubuntuserver,   localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.1.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous,noplaintext
smtpd_sasl_tls_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes

smtpd_recipient_restrictions =  permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes

#smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem

问题详情

我现在收到connection closed by foreign host的提示,同时日志里反复出现fatal: no SASL authentication mechanisms的错误。我是按照官方教程安装的Postfix并创建了SSL证书,现在不知道哪里配置错了,导致SASL认证出问题,希望各位能帮忙排查一下原因,给出解决建议。

备注:内容来源于stack exchange,提问作者Doujinx

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.20 06:59:38