IMAP STARTTLS fails

Issue #908 resolved
Daniel Fancsali created an issue

While setting up an email server on Debian 10.4 using Monit 5.26.0, I’ve found something very odd.

Both the plain and encrypted (with STARTTLS) methods on the SMTP port are working fine:

check host "localhost smtp" with address localhost
    if failed port 25 with protocol smtp then alert

check host "localhost smtps" with address localhost
    if failed
    port 25
    protocol smtps and certificate valid > 10 days
    then alert

Checking the unsecure IMAP is also fine:

check host "localhost imap" with address localhost
    if failed
    port 143 with
    protocol imap then alert

However, the following rule, trying to monitor the STARTTLS on IMAP fails:

check host "localhost imaps" with address localhost
    if failed
    port 143
    protocol imaps and certificate valid > 10 days
    then alert

The error message says:

Connection failed | Timestamp failed

SMTP is served by Postfix 3.4.10 and the IMAP server is Dovecot 2.3.4.1. Both work fine with other software, so I assume they’re both speaking STARTTLS very well. (Checked them both with openssl s_client and they seemed to be fine.)

Comments (6)

  1. Tildeslash repo owner

    Monit doesn’t implement STARTTLS for the IMAP protocol currently, you can check:

    1. either port 143 with plain “imap”
    2. or port 993 with “imaps” (which performs SSL handshake immediately)

    We can add support for IMAP STARTTLS in the future.

  2. Log in to comment