Articles in this section

Unable to log in webmail with courier_imaps service on Plesk server: 504 Gateway Timeout

Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  • Unable to log in Roundcube webmail with 504 Gateway Timeout error
  • Courier service restarts frequently;
  • Horde webmail gives Error connecting to mail server error;
  • Errors below can be found in the file /var/log/maillog :

    CONFIG_TEXT: courier-imaps: 39 active connections.
    ...
    Unexpected SSL connection shutdown
    courier-imaps: 40 maximum active connections.
    Unexpected SSL connection shutdown.
    Unexpected SSL connection shutdown

  •  The following message can be found in /var/log/maillog when the issue occurs:

    CONFIG_TEXT: courier-imaps: NOTICE: Disconnected during shutdown by signal

  •  /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 

  • In case if Watchdog is installed on the server, courier_imaps service restarts frequently;
  • Watchdog log file /var/log/plesk/modules/monit.log has the following entries:

    CONFIG_TEXT: 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

Cause

IMAPs connection limit being reached.

In case if Watchdog is installed, it fails to perform a test connection due to IMAPs connection limit being reached.

Resolution

  1. Log into Plesk

  2. Go to Tools & Settings > Mail Server Settings > Maximum number of connections (IMAP, POP3, IMAP over SSL/TLS, or POP3 over SSL/TLS).
    Increase the maximum number of connections, e.g if 40 is set, increase it to 80.

  3. In case if Watchdog is installed, increase time during which Watchdog will be waiting for response from the polled service under Extensions > Watchdog > Courier*> Connection timeout
    mceclip0.png

    Note: increase parameter for all Courier services:
    Courier POP3 Server
    Courier POP3 Server with SSL/TLS support
    Courier IMAP server
    Courier IMAP server with SSL/TLS support

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.