Roundcubemail cannot connect to storage server anymore


I cannot login to roundcubemail for two days… :frowning:
The day before that everything worked still fine… (perhaps a update - I don’t know anymore for sure…). I didn’t change any configuration files however…

Now, every time I try to login, roundcubemail says “Connection to storage server failed”. In the /var/log/roundcubemail/error.log, I found IMAP Error: Login failed for from Could not connect to localhost:143: Verbindungsaufbau abgelehnt in /usr/share/roundcubemail/program/lib/Roundcube/rcube_imap.php on line 197 (POST /webmail/?_task=login?_task=login&_action=login) (where I replaced my domain name by… and sorry that it is german…)

I have already reinstalled roundcubemail, nethserver-roundcubemail and dovecot… but without any success regarding the error…

The line mentioned in the log is throws an if roundcubemail cannot connect to dovecot/imap…

does anyone have an idea? or do you need more information?

btw, I disabled selinux already for another reason (this has nothing to do with the error however - I have only read somewhere that the error could come also from selinux…)

Hi Aaron,
I found two things at Roundcube Forum,

  • a problem with upper case in the name
  • a missing entry at the host file

I hope it will help you

For our english speaking people


Connection refused

Also check your IMAP server is working correctly:

systemctl status dovecot

Thank you for your answers…! [quote=“m.traeumner, post:2, topic:6845”]
I found two things at Roundcube Forum,

  • a problem with upper case in the name
  • a missing entry at the host file
    All my users are lowercase… hence that cannot be the problem…
    I also checked the /etc/hosts file…The defining line of is localhost localhost.localdomain
    Looks as usual, or?

[quote=“giacomo, post:3, topic:6845”]
systemctl status dovecot
[/quote]~ ]# systemctl status dovecot dovecot.service - Dovecot IMAP/POP3 email server Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/dovecot.service.d limits.conf Active: active (running) since Wed 2017-05-17 18:33:49 CEST; 18h ago Main PID: 31167 (dovecot) CGroup: /system.slice/dovecot.service 31167 /usr/sbin/dovecot -F 31171 dovecot/anvil 31172 dovecot/log
hence, dovecot seems to be running correctly…

Any other suggestions?

You could check connection to port 143 with:

nc -v localhost 143

Example output:

Ncat: Version 6.40 ( )
Ncat: Connected to

[quote=“filippo_carletti, post:5, topic:6845”]
nc -v localhost 143
[/quote]~ ]# nc -v localhost 143 Ncat: Version 6.40 ( ) Ncat: Connection refused.
That is obviously the problem…!!! Thank you!! :wink:
But how to fix it?

Let’s check if dovecot/imap is listening on port 143 with:
fuser -vn tcp 143

Example output:

            USER        PID ACCESS COMMAND
143/tcp:    vmail      1206 F.... imap
            vmail      1217 F.... imap

Then dovecot config:

config show dovecot | grep Port

Check /var/log/imap content, even after restarting dovecot.


This gives me no output at all…! (even no error message)

this returns exactly the same ports as you have written… [quote=“filippo_carletti, post:7, topic:6845”]
Check /var/log/imap content, even after restarting dovecot

The last entry in this log file is from 15.05… there I logged in to roundcubemail the last time successfully… even no new entries when restarting dovecot service…

I think that dovecot is not running.
I can say that dovecot is stable as a rock, it never crashed in any of the hundreds of systems I administer, so I don’t have experience on debugging it.

Check this:

lsof -Pp $(cat /var/run/dovecot/ ) | grep LIST
dovecot 25287 root   16u     IPv4           21617330      0t0       TCP *:4190 (LISTEN)
dovecot 25287 root   17u     IPv6           21617331      0t0       TCP *:4190 (LISTEN)
dovecot 25287 root   18u     IPv4           21617332      0t0       TCP *:2000 (LISTEN)
dovecot 25287 root   19u     IPv6           21617333      0t0       TCP *:2000 (LISTEN)
dovecot 25287 root   29u     IPv4           21617358      0t0       TCP *:110 (LISTEN)
dovecot 25287 root   30u     IPv6           21617359      0t0       TCP *:110 (LISTEN)
dovecot 25287 root   31u     IPv4           21617360      0t0       TCP *:995 (LISTEN)
dovecot 25287 root   32u     IPv6           21617361      0t0       TCP *:995 (LISTEN)
dovecot 25287 root   44u     IPv4           21617400      0t0       TCP *:143 (LISTEN)
dovecot 25287 root   45u     IPv6           21617401      0t0       TCP *:143 (LISTEN)
dovecot 25287 root   46u     IPv4           21617402      0t0       TCP *:993 (LISTEN)
dovecot 25287 root   47u     IPv6           21617403      0t0       TCP *:993 (LISTEN)

I think you should collect some information and search/ask on the dovecot mailing list.
Dovecot wiki has a troubleshooting section:

1 Like

this outputs only ~ ]# lsof -Pp $(cat /var/run/dovecot/ ) | grep LIST dovecot 18438 root 16u IPv4 2462446 0t0 TCP *:4190 (LISTEN) dovecot 18438 root 17u IPv6 2462447 0t0 TCP *:4190 (LISTEN)

None of the other ports…!!
OK, I will try it on one of the dovecot mailing lists…
Nonetheless, thank you all very much!!!

This means that dovecot is acting only as a sieve server. You’re missing bot pop3(s) and imap(s). Ports 110 995 143 993.
Googling a bit, I found that you can disable protocols in dovecot.conf.
Here’s mine:

grep protocols /etc/dovecot/dovecot.conf 
# 20protocols -- configure access to mailboxes
protocols = imap lmtp sieve pop3

I see that imap is hardcoded, so I can’t imagine how you could have disabled it.

1 Like

my output ~ ]# grep protocols /etc/dovecot/dovecot.conf # 20protocols -- configure access to mailboxes protocols = imap lmtp sieve
only pop3 is missing…

Furthermore, I found in the /var/log/maillog many connections via dovecot but not from me…!! For example, May 18 16:35:02 assa dovecot: lmtp(23443): Disconnect from local: Successful quit
It seems that emails from/to my root account which are automatically sent by the server can be delivered by dovecot…
I will test if I can login via thunderbird… I also don’t guess that it works but…

I solved the problem!!! :wink:
I had somehow disabled the IMAP protocol via the server manager… it is under configuration -> email -> mailboxes -> Mailbox access protocols

Hence it was my own fault…
Now, roundcubemail is working again…!! :wink:

Again thank you all for your help…!

1 Like

Perhaps, one could add it in the inline help or/and in the admin manual that disabling IMAP there causes that roundcubemail doesn’t work anymore…! or what do you think?

What do you think about changing the word “IMAP” with “IMAP/Webmail”?

1 Like

Yes, I guess that would be great…!