Persistent IMAP connections

Egan egan@sevenkings.net
Wed, 16 May 2001 11:54:10 -0400


Hi,

After searching the archives I see there has been some discussion of
possibly using PHP4 sessions to create persistent IMAP connections.

Is anyone working actively on this?

I found a web mail client developed at the University of Valencia that
does persistent IMAP connections:

  ftp://ftp.uv.es/pub/unix/postman/postman.html

but their interface is not as attractive or complete as IMP.  It is
interesting though, to see how they implemented their solution for
persistent IMAP connections.  They basically create an IMAP client
process on the server which has c-client bundled in, and it keeps the
connection to the IMAP server alive, for some fixed length of time.

My testing indicates that they figured out some method of flushing out
an abandoned child process and starting a new one, if the user closes
the browser without logging out and then connects again.  That is what
is most interesting to me about their software.

If I get time, I might try hacking a similar solution into IMP using
some of the ideas and/or code from the uv.es software (it's GPLed).

Any insight from project veterans on this topic would be appreciated.
I can already see that IMP will not scale well if it has to make a new
IMAP connection for every HTTP request.

I use UW-IMAP with mbx as the default mailbox format.  The mbx format
(unique to UW-IMAP) gives good performance with most IMAP clients, so
changing the IMAP server is not an option I can consider at this time.

My idea is to time out the persistent connection after 7 minutes of no
activity.  My ISP experience tells me that 7 minutes will cover 90% or
more of all cases where the user is still active, and thus eliminate
90% or more of the IMAP connection startup requests IMP does now.