• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Error connecting to mail server.

Chris Parker

New Pleskian
Since moving to a new web server using ‪CentOS 6.8 (Final)‬ I cant get the email system to work

I cannot get into Horde , I get the message "Error connecting to mail server." and emails do seem to being forwarded

Can anyone suggest where I can look for the problem
 
Yes I have tried all the suggestions made in forum and knowledge base
I have found this in the log

IMAP Error: Login failed for [email protected] from 86.169.242.209(X-Real-IP: 86.169.242.209,X-Forwarded-For: 86.169.242.209). Could not connect to localhost:143: Connection refused in /usr/share/psa-roundcube/program/lib/Roundcube/rcube_imap.php on line 193 (POST /roundcube/?_task=login&_action=login)
 
Hi Chris Parker,

luckily, we are now getting closer, since you started to provide some little informations, which are needed to investigate the issue!

First, pls. note that it is irritating for people willing to help you, if you state:
I cannot get into Horde
... and later on provide a log - entry from ROUNDCUBE:
Connection refused in /usr/share/psa-roundcube/program/lib/Roundcube/rcube_imap.php on line 193 (POST /roundcube/?_task=login&_action=login)

Second, pls. note that it is impossible for people willing to help you, to guess what suggestions in forum and knowledge - base you already followed, if you don't provide some detail here.

Third, pls. be informed, that your IP is already blacklisted at: => http://dnsbl.inps.de/query.cgi?action=check&lang=en&ip=212.48.75.98
( this is irrelevant for your current issue, but you should solve this issue! )

Fourth, pls. be informed, that you have a missing DMARC - entry, missing default DKIM/DomainKeys - entries and as well missed to configure a valid SPF - entry for your domain at the nameserver of your domain registrar ( 123-reg.co.uk ).
( this is irrelevant for your current issue, but you should solve this issue! )

Fifth, pls. be informed, that you use a non-standard auth - mechanism ( => AUTH LOGIN DIGEST-MD5 CRAM-MD5 PLAIN ... instead of "AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN" )
( this is irrelevant for your current issue, but you should solve this issue! )

Sixth, your used mail - server certificate is still the default Plesk certificate ( self-signed and doesn't verify the domain ). Consider to change that.
( this is irrelevant for your current issue, but you should solve this issue! )


Now back to your issue:
IMAP Error: Login failed for [email protected] from 86.169.242.209(X-Real-IP: 86.169.242.209,X-Forwarded-For: 86.169.242.209). Could not connect to localhost:143: Connection refused in /usr/share/psa-roundcube/program/lib/Roundcube/rcube_imap.php on line 193 (POST /roundcube/?_task=login&_action=login)
I marked the important stuff here, which point to the following possible root causes:
  1. The imap - server might not be active. Pls. check whether courier-imap or dovecot ( as you can see, we can't guess, which software you use on your server, so pls. consider to provide such informations for investions reasons and to get possible solutions, which suits your environment! ) - services are in an active state and listed with the example command: "netstat -tulpn | grep :143" and/or "lsof -i | grep dovecot" / "lsof -i | grep courier". Pls check as well, if you are able to connect with the command: "telnet localhost 143"
  2. Your "host" - configuration could be insufficient. Pls. check that "/etc/hosts" contains not only the standard "127.0.0.1 localhost.localdomain localhost" entry, but as well your server - IP and the current server-domain, incl. the servername ( in your case, this would be: "212.48.75.98 356052.vps-10.com 356052"
  3. Your client IP could be blocked by Fail2Ban
  4. A firewall rule could block the access


If you need further help, pls. consider to provide MORE informations and don't forget to include the results of your commands from the command line.
 
Last edited by a moderator:
Sorry fr being unclear with my problem
I have tried the things you suggest - output below

On previous web servers I have experienced similar messages but It was resolved by adjusting the DNS records ,but this has not worked in thiscase

netstat -tulpn | grep :143 I get nothing back

netstat -tulpn I get :-

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:12768 0.0.0.0:* LISTEN 1656/psa-pc-remote
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1604/mysqld
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1254/rpcbind
tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 7049/sw-cp-server
tcp 0 0 212.48.75.98:80 0.0.0.0:* LISTEN 1732/nginx
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 27692/master
tcp 0 0 212.48.75.98:53 0.0.0.0:* LISTEN 2196/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 2196/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1445/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 27692/master
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 2196/named
tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 7049/sw-cp-server
tcp 0 0 212.48.75.98:443 0.0.0.0:* LISTEN 1732/nginx
tcp 0 0 :::7080 :::* LISTEN 11647/httpd
tcp 0 0 :::7081 :::* LISTEN 11647/httpd
tcp 0 0 :::106 :::* LISTEN 1456/xinetd
tcp 0 0 :::111 :::* LISTEN 1254/rpcbind
tcp 0 0 :::8880 :::* LISTEN 7049/sw-cp-server
tcp 0 0 :::465 :::* LISTEN 27692/master
tcp 0 0 :::53 :::* LISTEN 2196/named
tcp 0 0 :::21 :::* LISTEN 1456/xinetd
tcp 0 0 :::22 :::* LISTEN 1445/sshd
tcp 0 0 :::25 :::* LISTEN 27692/master
tcp 0 0 :::8443 :::* LISTEN 7049/sw-cp-server
udp 0 0 0.0.0.0:1005 0.0.0.0:* 1254/rpcbind
udp 0 0 0.0.0.0:111 0.0.0.0:* 1254/rpcbind
udp 0 0 212.48.75.98:53 0.0.0.0:* 2196/named
udp 0 0 127.0.0.1:53 0.0.0.0:* 2196/named
udp 0 0 :::1005 :::* 1254/rpcbind
udp 0 0 :::111 :::* 1254/rpcbind
udp 0 0 :::53 :::* 2196/named


I am running Dovecot

lsof -i |grep Dovecot gives nothing back

The hosts file contains:-

127.0.0.1 356052.vps-10.com 356052 356052.vps-10.com localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 356052.vps-10.com 356052 356052.vps-10.com localhost localhost.localdomain localhost6 localhost6.localdomain6

No mention of my ip address (212.48.75.98)

Fail2Ban is not installed on the Server

Thank you for your help
 
Hi Chris Parker,

according to your informations, dovecot is NOT running. Pls. restart dovecot ( "/etc/init.d/dovecot restart" or as well with the command "/opt/psa/admin/bin/mailmng-service --start-service --mail-component=imap-pop3" ) and investigate possible issues/errors from your mail - log. A command with for example "ps aux | grep dovecot" might as well point out, if dovecot is in an active state.

The hosts file contains:-

127.0.0.1 356052.vps-10.com 356052 356052.vps-10.com localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 356052.vps-10.com 356052 356052.vps-10.com localhost localhost.localdomain localhost6 localhost6.localdomain6

No mention of my ip address (212.48.75.98)
Consider to use for example:
Code:
127.0.0.1    localhost.localdomain    localhost

212.48.75.98    356052.vps-10.com    356052

127.0.0.1    356052.vps-10.com    356052
 
Thanks for your help
You are right Dovecot was Stopped
I tried to restart it but it failed with "files missing"
I have therefore de-installed it and installed the Courier option
This is now working
 
In my case it was a SSL handshake issue. localhost plus an actual cert for a different host, well. that'll never work. Turned off SSL when connecting to the localhost. Fixed it in my case.
 
Back
Top