Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

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

 
extensionsgohordeimapmail

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 :

    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:

    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:

    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

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

How to Host a Go App on Plesk

Read More »

Setting Up and Configuring a Linux Mail Server

Read More »

Getting Started With Plesk Extensions & Tools

Read More »
Knowledge Base

Unable to issue a Let’s Encrypt certificate for a domain or its mail in Plesk: the DNS challenge used another IP address

Read More »

Can’t access mail: Warning: Inotify instance limit for user exceeded

Read More »

Websites on Plesk server are slow or show error 500 or PHP mail cannot be sent: ap_pass_brigade failed

Read More »

Let’s Encrypt notification mail: Your certificate (or certificates) for the names listed below will expire in days

Read More »

Hosting Wiki

  • Django
  • Server Redundancy
  • Horde
  • QMAIL
  • Sendmail
  • Google Cloud CDN
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • MongoDB
  • Plesk
  • Web Server
  • DNS Server
  • SSL
  • Email Autoresponder
  • Mailing Lists
  • Email Alias
  • Email Virus Protection
  • Email Forwarding
  • Webmail
  • IMAP
  • POP3
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family