Re: [Logicmail-devel] IDLE not supported by IMAP server
Brought to you by:
octorian
From: bartek b. <maj...@gm...> - 2010-06-02 21:38:57
|
2010/6/2 Derek Konigsberg <dko...@lo...> > Ahh, this one: > http://www.logicprobe.org/proj/logicmail/ticket/181 > > Looks like the first thing I'll do is get bincimap up and running on my > little test server VM (its an OpenBSD install with Cyrus, Dovecot, and > Courier). > I could help here if you run into difficulties. > Getting it to work actually won't be too difficult on the coding side. The > real question is how to change the behavior of the mail connection handler > to cope with a lack of IDLE support. I'm pretty sure one of the desktop > e-mail clients I use (I think Kmail) doesn't use IDLE, so I'll have to > observe that one again in a packet sniffer to see how it operates. > > The overall behavior of the connection handling code is described in a > state machine diagram near the bottom of this web page: > http://www.logicprobe.org/proj/logicmail/wiki/design-mail > > Hopefully all that will have to change is the specifics of how the IDLE > state is handled. Right now, it does something like this: > - If no pending requests, go into IDLE > - If 5 minutes have elapsed without any new requests, exit the idle state, > do a status check, then resume IDLE (I think this is also how Thunderbird > works) > - Code is in: > org.logicprobe.LogicMail.mail.IncomingMailConnectionHandler.handleBeginIdle() > > To handle a non-IDLE-supporting server, I'll just have to implement a > similar timeout/poll loop without the IDLE state. This will obviously make > it less responsive to new messages, but should still work. (and will have > to do it for IMAP-only, since POP effectively locks the mailbox against > changes while you're connected) > > Yes, I made it to this point that this is where IDLE logic takes place. What you say doesn't sound too difficult, if I understand correctly, just issuing certain command at certain interval. And probably also changing the implementation of ImapClient.hasIdle() to actually check imap server capabilities. I agree on the responsiveness issue, probably the polling shouldn't also happen to often to take battery life into account. >From what you write I can see that you would like to implement this by yourself, anyway I'd be glad to help develop this great product:). Kind regards, -- Bartosz |