Feature #18
[patch requested] support for IDLE command
| Status : | Assigned | Start : | ||
| Priority : | Normal | Due date : | ||
| Assigned to : | John Goerzen | % Done : | 0% |
|
| Category : | IMAP | |||
| Target version : | - | |||
| Resolution : |
Description
Using offlineimap to synchronize large accounts (i.e. hundreds of folders, millions of mails)
can take a lot of time, memory and network bandwidth. When using cron to call offlineimap one
has to decide to either waste a lot of resources or only sync at large intervals.
I would like offlineimap to provide an IDLE mode. After fully synchronizing an account it should
enter a daemon-like state keeping the IMAP connection open and issue the
IDLE command. When new mail arrives on the server it should
automatically download it. For maildir repositories there should be support for FAM (gamin) or
inotify, therefore making the connection fully bidirectional.
History
11/14/2007 02:40 PM - frode -
This is the one thing missing from OfflineIMAP to make it complete, so consider this another vote :)
02/02/2008 01:22 PM - albertlash -
I would love to see this feature as well. How can I help? I know a little bit of python, but not that much about programming for IMAP.
03/03/2008 11:23 AM - John Goerzen
- Status changed from New to Assigned
Hi folks, this would indeed be nice to see but I don't see myself having time to code it up for free. Patches accepted ;-)
07/11/2008 09:22 AM - Adam Spiers
I'd love to see this too. John, "for free" sounds like it might imply that you might consider doing it if we paid; how much would it take? :-)
11/14/2008 09:10 AM - Adam Spiers
OK, let's try a different tack. Maybe I can find time to do it myself - but this is much more likely to happen if you could give me a high-level overview of what you think the best approach might be, since you know the code far better than I do. Thanks!
11/14/2008 10:45 AM - John Goerzen
To answer two questions...
The first, if you or others are serious about paying for it, send me an email at jgoerzen@complete.org and we can discuss. I have done OfflineIMAP work on a contract basis in the past and would be willing to do so again.
Now then, on the second...
There is a timer loop that runs between syncs. While it's running, it has threads that send NOOP to IMAP servers to keep them from timing out the threads. Also, the timer can be interrupted by keyboard input that requests an immediate sync.
So this will be where you will start -- with that delay loop.
Then probably what you will want is to have a config option that gives the name of a folder to monitor. You could create a thread that does nothing but monitor it, or coopt one of the NOOP-sending threads for that purpose perhaps. NOOP actually might cause the server to reply with new message counts; I forget.... but if so, this could be pretty easy and wouldn't even require IDLE.
One other thing is that I believe that IDLE is an extension, so you would have to make sure it's in the CAPABILITY string (or else have very careful error checking).