‘Error connecting to IMAP server’ in Squirrelmail – Here’s how to fix it

Table of Contents

Squirrelmail provides an easy way to check your emails.

However, sometimes it can lock you out and show errors.

One such error is “error connecting to IMAP server” in Squirrelmail.

At 1onlyhost, we help website owners resolve these errors as part of our Dedicated Support Services.

‘Error connecting to IMAP server’ in Squirrelmail – What’s this?

Customers usually see this error when they try to connect to Squirrelmail webmail client for checking emails. The complete error message looks like this.

"Error connecting to IMAP server: localhost. 111 : Connection refused"


This means that the IMAP server refused the connection made by the webmail client. So, our Support Experts primarily check the email logs(/var/log/mail.log or /usr/local/psa/var/log/maillog) to identify the origin of the problem.


‘Error connecting to IMAP server’ in Squirrelmail – Causes & Fixes

Now, let see the top reasons for this error and how our Dedicated Engineers fix them.

1) IMAP service downtime

One of the main reasons for this error is the IMAP service downtime on the server. Customers get locked out of Squirrelmail even though they give the correct login details. This is because the IMAP service isn’t active or dead in the server.

Here, our Support Experts first check the status of the IMAP service. Since the default IMAP port is 143, we check whether any service is listening on this port. For example, we use the below command to confirm if IMAP is running on the server.

netstat -lnpt | grep :143


Service downtime may occur due to many reasons like resource outage, disk errors, DDoS, traffic spikes, etc. Here, our Support Engineers identify and permanently fix the reason for the service downtime. Further, if we identify any dead process in the server, we’ll kill those process and restart the service. For example on CentOS 6, we restart the IMAP service using below command.

service dovecot restart


2) Firewall restrictions

Similarly, another common reason for this error is server firewall blocking connections to the server or IMAP port. We’ve seen instances where customer’s IP address or IP range get blocked on the server for abnormal activities.

Also, sometimes server firewall can block connections on IMAP ports 143 and 993 or these ports may not be opened in the server firewall. These can create problems and result in error connecting to IMAP server in Squirrelmail.

Firstly, our Support Engineers get the telnet results to IMAP port from the customer’s machine. This shows any connectivity issues between the user’s machine and the server.

telnet xxx.xxx.xxx.xxx 143


If we find that the connection doesn’t reach the server, we check whether there are any firewall rules offending the connection. For example, we use the below command to find the IP blocks on a Linux server.

iptables -nL


If the IP is blocked, we find the reason for the block and remove the block to restore email connectivity. Moreover, we make sure that the IMAP ports 143 and 993 are opened in the server to accept valid connections.


3) IMAP server configuration issues

Similarly, misconfiguration in the IMAP configuration file can also create problems. In other words typo mistakes, syntax errors, etc. can lead to this error connecting to IMAP server in Squirrelmail.

For example, we’ve seen customers face this error due to the wrong mailbox location specified in the dovecot configuration file. The mailbox of the customer is ‘/home/xxx/mbox‘. However, the mail_location wasn’t correctly given in the dovecot configuration file /etc/dovecot/dovecot.conf which created problems.

Our Support Engineers check and correct the configuration issues of the IMAP configuration file. Most importantly, we backup the configuration before making any changes.

[Need an expert to resolve this error? Our Support Engineers can help you here.]


In short, error connecting to IMAP server in Squirrelmail webmail client mainly occurs due to service downtime issues, firewall restrictions, etc. Today, we’ve discussed the top 3 reasons for this error and how our Dedicated Engineers fix them.

Leave a Comment

Your email address will not be published. Required fields are marked *

Social Share


Cheapest Web Hosting

Fasters Web Hosting Promo
Scroll to Top

Launch your Website at RS599

Create a professional website yourself with our domain hosting combo. Get Extra benefits at this Year end Sale with 10% OFF and Enjoy Amazing Deels on Shared Hosting!

Starting at Only RS599/Year

Year End Sale


Use Code STARTBIZ at Checkout.

Create an earning opportunity with A Web Hosting Business

Become reseller and start reselling domains, web hosting, ssl certificates and More.

45% OFF

Starting at RS399/Month


Use coupon: at the checkout.