连接到 Linux dovecot 邮件服务器时,Outlook 收到虚假 SMTP 错误

连接到 Linux dovecot 邮件服务器时,Outlook 收到虚假 SMTP 错误

我运行着一个大约有 30 人的邮件服务器。它没有出现任何问题。但上周,一些用户开始报告他们的电子邮件客户端 Outlook 出现错误:

Outlook 错误消息

检查发生错误时的服务器邮件日志,我只能发现这些条目都发生在同一时间。我甚至不确定这些条目是否与 Outlook 错误有关(似乎与 smtp 无关),但事实上,连接都在同一时间关闭,而且“等待输入”时间很长,这看起来很可疑:

 81218 Jan 18 11:56:56 ip-172-30-0-131 dovecot: imap(t.olixxxx)<3739040></Z84+joPNhRsOgYu>: Connection closed (IDLE running for 0.001 + waiting input for 1175.376 secs, 2 B in + 10 B out, state=wait-input) in=182 out=172366 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0        body_bytes=0
 81219 Jan 18 11:56:56 ip-172-30-0-131 dovecot: imap(s.damxxxx)<3739037><iQY3+joPottsOgYu>: Connection closed (IDLE running for 0.001 + waiting input for 1174.763 secs, 2 B in + 10 B out, state=wait-input) in=182 out=799331 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0        body_bytes=0
 81220 Jan 18 11:56:59 ip-172-30-0-131 postfix/smtpd[3740240]: warning: hostname 179.hosted-by.198xd.com does not resolve to address 45.129.14.179: Name or service not known
 81221 Jan 18 11:56:59 ip-172-30-0-131 postfix/smtpd[3740240]: connect from unknown[45.129.14.179]
 81222 Jan 18 11:57:00 ip-172-30-0-131 dovecot: imap(j.pomexxxxx)<3739095><k7z3/zoPqLdsOgYu>: Connection closed (IDLE running for 0.001 + waiting input for 1078.221 secs, 2 B in + 10 B out, state=wait-input) in=165 out=801497 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=       0 body_bytes=0
 81223 Jan 18 11:57:00 ip-172-30-0-131 dovecot: imap(a.cerxxxxx)<3739042><JCXQ+joPu5JsOgYu>: Connection closed (IDLE running for 0.001 + waiting input for 1169.527 secs, 2 B in + 10 B out, state=wait-input) in=182 out=303618 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0        body_bytes=0
 81224 Jan 18 11:57:00 ip-172-30-0-131 dovecot: imap(h.foxxxxx)<3739034><kpEo+joP9g5sOgYu>: Connection closed (IDLE running for 0.001 + waiting input for 1180.675 secs, 2 B in + 10 B out, state=wait-input) in=194 out=1927 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 bo       dy_bytes=0
 81225 Jan 18 11:57:00 ip-172-30-0-131 dovecot: imap(dxxxxxx)<3739057><xljV/DoPPnZsOgYu>: Connection closed (IDLE running for 0.001 + waiting input for 1135.454 secs, 2 B in + 10 B out, state=wait-input) in=182 out=458253 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 bod       y_bytes=0

对于用户来说,这些错误并不是一直都会发生,但发生的频率足以让人烦恼。我在 Debian bullseye 上运行 dovecot 和 postfix。

答案1

Dovecote 是您的 IMAP 服务器。它允许邮件客户端检索发送到邮箱的电子邮件。在您的设置中,电子邮件发送(SMTP)由 Postfix 处理。您向我们显示的错误与 SMTP 有关。您的帖子主题是错误的。

如果两台服务器都在同一主机上运行,​​并且您仅有的查看 SMTP 错误,这表明 SMTP 服务器存在问题,而不是主机或网络存在问题(但远非定论)。

您检查了所有日志还是仅检查了邮件日志?

顺便说一句,这些日志条目本身并不是错误 - 并且与您在图片中向我们展示的内容没有直接关联。

即使对于像这样的小型设置,也建议进行一些监控。我还建议测试 Outlook 在失去与 IMAP 服务器的(已建立的)连接时是否会报告错误。

答案2

问题的根源是用户在移动设备上输入了错误的密码。在客户端的 wifi 网络上,设备不断尝试登录。当登录失败次数达到阈值时,fail2ban 软件会禁止该 IP 地址访问服务器 10 分钟。这会影响其他人的登录能力。

一旦被禁止,邮件日志就不会显示任何活动,而我在这里发布的日志是我追逐鬼魂的。

然而,幸运的是,我发现了一个日志条目,其中显示用户有“身份验证失败”消息。这时我突然灵光一闪:“该用户可能被 fail2ban 封禁了。”唯一的谜团是为什么其他用户也被封禁了。不久之后,我发现密码错误的用户的一个 IP 地址是 T-mobile IP 地址,这让这个问题变得显而易见。

答案3

根据您提供的信息,您遇到的问题似乎与 Dovecot 有关。您分享的日志条目表明,在等待输入 1175.376 秒后,连接已关闭。这可能是由于多种原因造成的,例如网络连接问题、配置设置不正确或资源过度使用。要解决此问题,我建议按照以下步骤操作:https://www.linode.com/docs/guides/troubleshooting-problems-with-postfix-dovecot-and-mysql/

相关内容