Monit无法通过SSL IMAP连接到Dovecot

我运行Monit来检查Debian服务器上的进程。 对于所有其他服务(Apache SSL,Postfix,SSH等),其正常工作,但是对于Dovecot的Monit检查失败了。 我认为这可能已经开始安装一些软件包更新后,但我不知道什么时候。

由于电子邮件仍在工作,Dovecot正在为客户端连接正常工作。 我已经尝试用open_ssl s_client进行testing,对于SSLv3,TLS1.1和TLS1.2来说,这一切看起来都不错。

/ etc / monit / monitrc 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部分: 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,但我已经尝试用所有这些选项轮streamreplace“sslauto”但没有运气:SSLV2 | SSLV3 | TLSV1 | TLSV11 | TLSV12

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

提前致谢

这个问题是由TomDogg提到的http://osdir.com/ml/ubuntu-security-announce/2014-05/msg00023.html造成的。

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

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

以下是可能的解决scheme:

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

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

  2. 像Sebastian S在他的回答中提到的那样监视pop或imap没有SSL。

     if failed host localhost port 143 type tcp protocol imap then restart 
  3. 监视端口只有没有imap或stream行,build议kexik

     if failed port 993 for 5 cycles then restart 

选项1是唯一真正的解决scheme,因为另外两个方法迫使你testing你希望testing的不同的东西,但是当你等待更新时,它们至less可以轻松地提供类似的testing。

如果要一般地监视dovecot,可以考虑使用以下configuration来监视没有SSL的端口143:

  if failed host localhost port 143 type tcp protocol imap then restart 

检查您的版本:

 $ monit -V 

TLSV11TLSV12代替sslauto只能从5.8开始。

(比如Ubuntu,截至今天,它们的回购只有5.6 。)

在这里find关于问题/提交的更多细节: https : //bitbucket.org/tildeslash/monit/issue/14/monit-33-add-support-for-tlsv11-and-tlsv12

所以你可以:

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

b)强制机器使用较旧的TLS版本,例如SSLV2SSLV3TLSV1 ,并将sslauto保留在sslauto中,或

c)注释掉monit支票,直到你的发行版有5.8可用。