The eclectic musings of a bitter software engineer.

For those times when I’m away from home and need to check my email, there’s nothing better than a web-based IMAP client. I run a private installation of Imp restricted to allow connections only to wonko.com and a few other mail servers. While perusing my server logs today, I noticed that a few of my friends have been using it quite a lot to check their own email, which I think is cool; Imp is a great mail client and I like being able to provide a service for my friends.

Unfortunately, like all PHP-based webmail systems, Imp is unable to maintain IMAP connections between pageviews due to PHP’s stateless architecture. This means that each time someone clicks on a link, Imp has to reconnect to the IMAP server. For users whose mail is hosted on wonko.com this is pretty fast, but for people using remote IMAP servers, this can be painfully slow. I couldn’t stand the thought of my poor friends having to endure slow load times, so I set about improving the situation. What I needed was a program that would act as a proxy between Imp and the remote IMAP servers, keeping connections open between page requests.

There are two programs that do this, both called (unsurprisingly) imapproxy. One of them was once a side project of Horde (the folks responsible for Imp), but it’s no longer being maintained. The other one is being actively maintained and appears to be widely used.

Neither of them supports caching connections to more than one remote server.

It seems simple enough. imapproxy runs as a daemon on the local machine, accepts connections from clients, and passes those connections to a remote server specified in the imapproxy config file. Only one remote server, though. This makes sense, because imapproxy has no way of identifying which incoming connections are for which remote server. But would it have killed the developers to have imapproxy automatically start multiple daemon processes on a range of consecutive ports if multiple remote servers are specified in the config file?

I can probably accomplish the same thing with a shell script and some tweaking, but it would have been nice not to have to do any work, you know?

Comments

Have you tried SquirrelMail? I give my friends shell accounts, so they can set up fetchmail and consolidate their email that way and have it pre-fetched when they use my installation.

Wednesday April 14, 2004 @ 02:01 AM (PDT) Posted by Baloo_Ursidae

Yes, I've used SquirrelMail. It's good too, but I could just as easily use fetchmail with Imp.

Wednesday April 14, 2004 @ 02:03 AM (PDT) Posted by Ryan Grove
Long time reader, first time poster. Or some-such.

Happened upon PHPSlice a long time ago - I asked you if I could steal and mod your chat code for my own website and you said go for it. (The site was built around Thatware, for reference - The stuff that spawned the general assness that is PHP-Nuke)
Just to stroke your ego a bit more, I use still use PHP-Slice internally where I work, for the dissemination of info.

But I'm sure most of us are really just waiting to see a good looking lady with a gun across her chest again.
Well... Maybe that's just me.

Wednesday April 14, 2004 @ 10:54 PM (PDT) Posted by John_Zorn
And somehow adding it to the wrong article - Its been a long night...

Later on.

Wednesday April 14, 2004 @ 10:55 PM (PDT) Posted by John_Zorn

Yo

Hey Ryan, I'm the Hollywood Video mofo, Todd. I didnt mean for it to sound like I was attending merlo, I graduated in 2001. Anyway, uh yeah, and fuck you to one who started the whole I love Pie thing that annoyed the hell out of me my senior year :)

Saturday April 17, 2004 @ 05:43 AM (PDT) Posted by skawave

wrong post

Saturday April 17, 2004 @ 05:43 AM (PDT) Posted by skawave

Hey! I started the whole I love pie thing. Only it was "Pie is good".

Saturday April 17, 2004 @ 11:48 AM (PDT) Posted by Ryan Grove

Well, Fuck you to you then...you! Any merlo staff (i.e Steve Hamilton) read this site?

Sunday April 18, 2004 @ 09:54 AM (PDT) Posted by skawave
Post a comment

Basic XHTML (including links) is allowed, just don't try anything fishy. Your comment will be auto-formatted unless you use your own <p> tags for formatting. You're also welcome to use Textile.

Don't type anything here unless you're an evil robot:


And especially don't type anything here:

Copyright © 2002-2008 Ryan Grove. All rights reserved.
Powered by Thoth.