Dovecot: unable to connect to localhost:143

While we are login to squirrel mail the following error message is occur and as per the error message the dovecot mail service is not able to connect to the imap mail server on port number 143.

Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:143 (Connection refused) in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/login_auth/functions.php on line 129

To resolve the above error message refer to the following steps.

1st) Make sure that IMAP service is running. If not then restart the dovecot mail service by using the following command.

/etc/init.d/dovecot restart

2nd) If imap service is not able to start then open the file dovecot configuration file /etc/dovecot.conf and add imap/imaps in to the protocols line as follows:

protocols = pop3 pop3s imap imaps

Now restart dovecot service and browse the squirrel mail and if you are still receiving the error message then rebuilt the dovecot mail service by using the following command.

/scripts/dovecotup –force

About Anant 386 Articles
Senior technical writer