Reading *everything* IMAP gives



At this moment will the IMAP code ignore quite a bit of the information
that it *can* receive.

I have already implemented support for IDLE (Push E-mail) which will
read and act upon the EXISTS and EXPUNGE unsolicited responses. There
are also RECENT (not so interesting) and FETCH (for getting notified
about for example flag changes).

Also note that at this moment the support for EXPUNGE is not always very
correct (it can miss or loose expunges, on race situations. Especially
when a lot messages are being expunged at the same time. Which is the
typical situation when expunging is happening by the way).

The idea is to non-blocking read-away all information before a next
command happens, and in an idle handler (that happens each 5th second)
do the same thing but then in an IDLE. 

For example how it's today:

--> Select a folder situation
C: a01 LOGIN tnytest tnytest
C: a02 SELECT INBOX (CONDSTORE)
C: a03 UID FETCH 1:4 (FLAGS) (CHANGEDSINCE 5)
-> Local flags are updated
C: a03 IDLE
S: idling+
-> the idle handler each 5th second reads non-blocking
S: EXISTS 5
-> The idle handler will perform imap_update_summary
   C: DONE
   C: a04 UID FETCH 4:5 (UID FLAGS ENVELOPE...)
   -> Message #5 will be added locally
   C: a05 IDLE 
-> the idle handler each 5th second reads non-blocking

How it would be:
--> Select a folder situation
C: a01 LOGIN tnytest tnytest
C: a02 SELECT INBOX (CONDSTORE)
C: a03 UID FETCH 1:4 (FLAGS) (CHANGEDSINCE 5)
-> Local flags are updated
C: a03 IDLE
S: idling+
-> the idle handler each 5th second reads non-blocking
S: EXISTS 5
-> The idle handler will perform imap_update_summary
   C: DONE

   -> Read away everything that might have happened
      and process it (like EXPUNGE, other EXISTS and FETCH)

   C: a04 UID FETCH 4:5 (UID FLAGS ENVELOPE...)
   -> Message #5 will be added locally

   -> Read away everything that might have happened
      and process it (like EXPUNGE, other EXISTS and FETCH)

   C: a05 IDLE 
-> the idle handler each 5th second reads non-blocking


ps. This is quite technical and difficult stuff. Nevertheless is
everybody interested in this type of things very invited. I can really
*indeed* use some help here.


-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]