[PATCH] Re: IMAP.cachemessagelist(): Protect against empty folders

Nicolas Sebrecht nicolas.s-dev at laposte.net
Tue Sep 6 21:26:38 BST 2011


On Tue, Sep 06, 2011 at 08:55:31PM +0200, Nicolas Sebrecht wrote:
> On Tue, Sep 06, 2011 at 08:44:35PM +0200, Nicolas Sebrecht wrote:
> > On Tue, Sep 06, 2011 at 07:08:21PM +0200, Nicolas Sebrecht wrote:
> > > On Tue, Sep 06, 2011 at 09:07:07AM +0200, Sebastian Spaeth wrote:
> > > > On Mon, 05 Sep 2011 13:17:54 -0500, John Wiegley <jwiegley at gmail.com> wrote:
> > > > > >>>>> Sebastian Spaeth <Sebastian at SSpaeth.de> writes:
> > > > > 
> > > > > > When invoked with FETCH 1:* (UID), imaplib returns [None] for empty
> > > > > > folders. We need to protect against this case and simply 'continue' here.
> > > > > 
> > > > > Thanks, that's fixed it.
> > > > 
> > > > Good to know, Nicolas ready to push? We got a Tested-by here :-)
> > > 
> > > Yep, merged. Thanks both!
> > 
> > Unfotunately, I think I'll be somewhat bored by the current behaviour.
> > It raises false positive in the sense that I have and want empty folders
> > (to group subfolders).
> > 
> > Example:
> > 
> > ERROR: Exceptions occurred during the run!
> >  ERROR: Aborting folder sync 'INBOX.ABUL' [acc: 'nis']
> >   FETCHING UIDs in folder [Remotenis]INBOX.ABUL failed. Server responded '[NO] ['No matching messages']'
> >  ERROR: Aborting folder sync 'INBOX.DRAFT' [acc: 'dev']
> >   FETCHING UIDs in folder [Remotedev]INBOX.DRAFT failed. Server responded '[NO] ['No matching messages']'
> > 
> > Notice I'm not totally convinced this issue comes from this patch. :-/
> 
> Seems the behaviour comes from commit 3302940
> 
>   "Proper error handling for SEARCH and FETCH failures from the server"
> 
> instead. Sorry for the mistake.

Thinking about this issue a bit more, a repository option like

  ignore_empty_folder_errors = ['INBOX.ABUL', 'INBOX.DRAFT']"

may do the trick.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list