courier_imaps service restarts frequently


2017-07-14 12:09:41 UTC


2017-08-16 17:22:47 UTC


Was this article helpful?

Have more questions?

Submit a request

courier_imaps service restarts frequently

Applicable to:

  • Plesk for Linux


  • courier_imaps service restarts approximately every half an hour.

  • Watchdog is installed on the server.

  • The log file /var/log/plesk/modules/monit.log has the following entries:

    monit: embed_ssl_socket(): Openssl read timeout error!
    'courier_imaps' failed, cannot open a connection to INET[localhost:993]
    'courier_imaps' stop: /usr/local/psa/admin/bin/mailmng-service
    'courier_imaps' process is not running
    'courier_imaps' trying to restart
    'courier_imaps' start: /usr/local/psa/admin/bin/mailmng-service
    'courier_imaps' process is running with pid 6088
    'courier_imaps' connection passed
  • Errors below can be found in the file /var/log/maillog :

    wp01 courier-imaps: 39 active connections.
    wp01 courier-imaps: 40 maximum active connections.
  • /var/log/messages showing courier_imaps not being running:

    # grep "'courier_imaps' process is not running" /var/log/messages
    wp01 monit: 'courier_imaps' process is not running
    wp01 monit: 'courier_imaps' process is not running
    wp01 monit: 'courier_imaps' process is not running


Watchdog fails to perform a test connection due to IMAPs connection limit being reached.


  1. Connect to the server using SSH/RDP.

  2. Increase the maximum number of connections, e.g if 40 is set, increase it to 80:

    # grep MAXDAEMONS /etc/courier-imap/imapd-ssl
    # Feel free to redefine MAXDAEMONS, TCPDOPTS, and MAXPERIP.
  3. Configure Watchdog to check IMAPs connection using a pidfile. For doing that comment the line below in the in IMAPs section of the file /usr/local/psa/etc/modules/watchdog/service.d/courier-imap :

    # if failed port 993 type tcpssl protocol imap with timeout 60 seconds then stop
  4. Restart Courier related and Watchdog services:

    # service courier-pop3s restart
    # service courier-imaps restart
    # service monit restart
Have more questions? Submit a request
Please sign in to leave a comment.