Frank Groeneveld's blog

Using Imapproxy to Speedup Webmail

Yesterday, I discovered a great way to improve the speed of your webmail client. Two friends of mine were talking about something called imapproxy.
Apparently this is a simply brilliant tool. It was invented because the web is stateless, but imap is not. Your webmail client (for example Roundcube) will reconnect to the imap server everytime you click a link or refresh. This introduces a great deal of lag. The solution to this problem is imapproxy. Your webmail client connects to the proxy and imapproxy opens a connection to the imap server. When the webmail client disconnects, the proxy keeps the connection open for another 5 minutes, so when you refresh or change directory, this can be done very fast!
I installed imapproxy on the webserver of my company. At first I couldn’t get it to work, because I wanted it to connect to imap over ssl, but after enabling “plain text” imap for localhost, I let imapproxy connect to it and everything worked. The roundcube installation now reacts almost instantly!
So remember, don’t try to let imapproxy use ssl, because the only error you will notice is that imapproxy is not listening on any port. The developers just forgot to add error reporting I guess.