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.
Help/advice would be much appreciated.