Virtualmin – RoundCube – Cannot connect to IMAP server

Recently, a client faced this issue on his VPS.

Steps to solve –

1. Login to Virtualmin
2. Go to Webmin > Servers > Dovecot
3. Go to Network
4. Select IMAP alongwith any other required protocol.
5. Save and Apply Settings.

This should fix it.