From: Piers L. <pi...@ja...> - 2012-02-06 23:32:24
|
Interesting discussion. As far as I remember, the general advice when using IMAP is to avoid message numbers for anything except an approximate guide, and to always use UID when changing any message. In my user agent, when an EXISTS turns up, I always then do a UID SEARCH ALL. However, that patch was for an old version of imaplib2, the current (2.33) version has an ordered list: def _append_untagged(self, typ, dat): # Append new 'dat' to end of last untagged response if same 'typ', # else append new response. if dat is None: dat = '' self.commands_lock.acquire() if self.untagged_responses: urn, urd = self.untagged_responses[-1] if urn != typ: urd = None else: urd = None if urd is None: urd = [] self.untagged_responses.append([typ, urd]) urd.append(dat) self.commands_lock.release() if __debug__: self._log(5, 'untagged_responses[%s] %s += ["%s"]' % (typ, len(urd)-1, dat)) which, presumably, also solves your problem. Piers. |