Monit 无法通过 SSL IMAP 连接到 Dovecot

Ben*_*Ben 7 ssl debian dovecot tls monit

我运行 Monit 来检查 Debian 服务器上的进程。它对所有其他服务(Apache SSL、Postfix、SSH 等)正常工作,但 Monit 对 Dovecot 的检查反复失败。我认为这可能是在安装一些软件包更新后开始的,但我不确定何时开始。

由于电子邮件仍在工作,Dovecot 为客户端连接正常工作。我已经尝试过使用 open_ssl s_client 进行测试,并且对于 SSLv3、TLS1.1 和 TLS1.2 似乎也很好。

/etc/monit/monitrc 中的 Dovecot 部分: check process dovecot with pidfile /run/dovecot/master.pid start program = "/usr/sbin/service dovecot start" stop program = "/usr/sbin/service dovecot stop" if failed port 993 type tcpssl sslauto protocol imap then unmonitor

当我启用对 Dovecot 的监控时,我在 /var/log/monit 中收到此消息: 'dovecot' failed protocol test [IMAP] at INET[localhost:993] via TCPSSL -- IMAP: error receiving data -- Success

我认为它可能是这样的https://secure.kitserve.org.uk/content/ssl-tls-version-conflict-zarafa-monit但我已经尝试用所有这些选项依次替换“sslauto”,但没有运气:SSLV2|SSLV3|TLSV1|TLSV11|TLSV12

我一直在指的 Monit 文档在这里:http : //mmonit.com/monit/documentation/#connection_testing

提前致谢

mho*_*ost 5

该问题是由TomDogg 提到的http://osdir.com/ml/ubuntu-security-announce/2014-05/msg00023.html引起的。

这个论坛有更多细节:http : //comments.gmane.org/gmane.comp.monitoring.monit.general/7378

仅供参考,即使您尝试使用 POP 而不是 IMAP,问题也是一样的。

以下是可能的解决方案:

  1. 应用这两个补丁或等待它们成为主流版本的一部分:

    http://hg.dovecot.org/dovecot-2.2/rev/09d3c9c6f0ad
    http://hg.dovecot.org/dovecot-2.2/rev/7129fe8bc260

  2. 正如 Sebastian S 在他的回答中提到的那样,在没有 SSL 的情况下监控 pop 或 imap。

    if failed host localhost port 143 type tcp protocol imap then restart
    
    Run Code Online (Sandbox Code Playgroud)
  3. 按照 kexik 的建议,仅在没有 imap 或 pop 的情况下监控端口

    if failed port 993 for 5 cycles then restart
    
    Run Code Online (Sandbox Code Playgroud)

选项 1 是唯一真正的解决方案,因为其他两个强制您测试您希望测试的不同内容,但它们至少可以在您等待更新时轻松提供类似的测试。


Tom*_*ogg 0

检查您的版本:

$ monit -V
Run Code Online (Sandbox Code Playgroud)

替换sslautoTLSV11orTLSV12只能以 开头5.8

(例如,Ubuntu 截至5.6今天仅在其存储库中。)

在此处查找有关问题/提交的更多详细信息:https://bitbucket.org/tildeslash/monit/issue/14/monit-33-add-support-for-tlsv11-and-tlsv12

所以你可以:

a) 强制将 monit 更新到版本5.8(或更高版本),或者

b) 强制您的计算机使用较旧的 TLS 版本,例如SSLV2SSLV3TLSV1并保留sslauto在您的监控检查中,或者

c) 注释掉 monit 检查,直到您的发行版可用5.8