Simon Josefsson <[EMAIL PROTECTED]> > UID SEARCH UID generates quite some data too, but it is just a > fraction of the above.
Well, you can improve on that too. I use a combination of FETCH UID and UID FETCH UID, and a loop that splits unknown UID ranges into smaller ranges. Assume that in my cache, I know there to be 1500 messages between UID 12000 and 14000. OK, I send UID FETCH UID 12000,12500,13000,13500,14000 (or maybe something like FETCH UID 1000,1500,2000,2500). When the result comes back, I'll have a handful of smaller ranges, and with luck I'll know that my cache is accurate for some or all of those ranges. If my cache is not accurate for a range, I subdivide once more. Eventually the unknwon ranges are small enough that I can do e.g. UID FETCH UID 12001:12031. The algorithm works fairly well, in my experience. It rather quickly finds contiguous MSN/UID series and accurate parts of the cache, and appears to scale very well. (My theory is that mailboxes grow large when one doesn't delete anything, so there'll be many contiguous MSN/UID ranges.) Regarding server bugs: If a given server works with Outlook, then it should also work with algorithms like this. --Arnt
