Gmail to "gmail apps" sync: ValueError: Backend could not find uid for message

chris coleman christocoleman at yahoo.com
Tue Jun 28 04:05:54 BST 2011


>On Mon, 27 Jun 2011 02:22:17 -0700 (PDT), chris coleman wrote:

>> @Sebastian: What's your thoughts on fixing imaplib2 or offlineimap, so
>> they respond properly when an untagged CAPABILITIES response arrives
>> at any time.
>
>Piers, the imaplib2 maintainer (although Nicolas is basically taking
>over ;-)) has indicated that we should be doing that from offlineimap, and
>I'll send a patch to that regard. OfflineImap already makes use of the
>APPENDUID reply from Gmail,
 so there will no change in behavior.
>
>> Just in case, one day a user gets an IMAP server that changes the capabilities. Imagine a cluster scenario, the 1st IMAP server goes down, the load balancer switches over to the 2nd IMAP server, which announces different capabilities.
>
>Well, the suggested fix (requery capabilities after login) won't help
>that scenario as your imagined switchover could happen at any point in
>time and not just pre/post login.
>
>Sebastian

@Sebastian : Wouldn't a better way to solve this bug (caused by failing to process legitimate, untagged messages from the IMAP server), and solve it (any any other unforeseen bugs) for any future scenario:  for offlineimap to delay querying imaplib2 for UIDPLUS capability until JUST BEFORE the various places in the offlineimap code where a UID might be received as part of a response.  Then, depending on the response, the code would branch between different code paths: the UID case and the no-UID case.

It sounds like this solution is possible without any upgrade to imaplib2, which updates its cached CAPABILITIES array every time
 it receives new capabilities from the imap server, from what you've said.

The bigger point is: it seems this bug was caused by offlineimap not fully complying to the IMAP4 client spec according to the requirement to accept and process any response from the server at any time.

Taking a step back, why shouldn't offlineimap/imaplib2 follow the IMAP spec completely?  Obviously it's not an easy client spec to implement 100%, because the client must behave more like a hybrid client/server.  A simple dumb client (such as POP3) can be very simple, and way easier to implement, because it just makes requests, and receives only deterministic answers stemming directly from those requests.  

It's a much greater challenge to make offlineimap as utterly bulletproof as fetchmail/pop3.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110627/5a42e81b/attachment-0003.html>


More information about the OfflineIMAP-project mailing list