I have tried localhost as well as 127.0.0.1 to connect to my Dovecot server. Nothing is visible in the Dovecot logs to indicate a connection is being made or attempted.
Can you log into your web server and connect to your imap server using the telnet command, ie telnet localhost 143 ?
FWIW, RCU works fine with my dovecot instance here. In my case I have it bound to just my eth0 address, not *, so I have to tell the various web apps to connect to the host's real IP address instead of localhost.
List info: http://lists.roundcube.net/users/