After doing some searching on the Virtualmin forums for this error, I found three separate threads and all three issues were quickly rectified by starting postfix/dovecot. Unfortunately none of the methods posted in those threads were successful in solving my problem.
I am running Ubuntu 10.04 LTS with the Virtualmin package installed. Everything was running fine until we started to have problems with webmail. You are able to login and authenticate yourself via webmail but the inbox and folders fail to load and an error message pops up “Failed to connect to localhost:143 : Connection timed out”
I have gone ahead and made sure both postfix and dovecot are working- but they must be working because everything worked previously. Also- mail through third-party applications such as Outlook/Thunderbird continue to work without any issues- so the SMTP/Mailserver is running properly and delivering/sending mail. I am guessing that the issue must be related to Dovecot since the IMAP port 143 is timing out.
There is no firewall running, and I flushed iptables just in case and then stopped the service from starting up automatically.
Looking at the following error logs:
/var/usermin/miniserv.error => no errors.
/var/usermin/miniserv.log => no errors.
I ran ‘dovecot --error-log’ and checked /var/syslog for the dovecot error dump but once again I could not find any error messages relating to IMAP or failure to load/find the mailbox.
My postfix/dovecot conf files remain unchanged- since they are delivering mail successfully as long as webmail is not used.
I made sure that dovecot.conf was listening for imap.
protocols = imap imaps pop3 pop3s
I’m not quite sure what would have changed/caused webmail to no longer work. The issue is fairly recent and as far a I am aware there have been no updates done to the server.
Okay, so as you said, there’s no firewall setup there. And it looks like Dovecot is listening on port 143, the port that timed out when you were trying to use the webmail.
What happens if you try to telnet to port 143 from on your server…
That is, if you log into your server over SSH, and then run this command:
telnet localhost 143
Do you get something like this:
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
OK [CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS STARTTLS AUTH=PLAIN] Dovecot ready.
Looks like that fixed it! Thanks for your very prompt and insightful help. I’ll keep an eye on it and see if there are any other issues.
Any idea what happened? What I mean is- the /etc/hosts file was never altered before and webmail worked fine. What could have prompted the sudden adherence to FQDN?