[PATCH] Re: properly check whether dstfolder supports labels

Nicolas Sebrecht nicolas.s-dev at laposte.net
Mon Apr 6 23:06:05 BST 2015


On Mon, Apr 06, 2015 at 11:23:05PM +0200, Abdó Roig-Maranges wrote:

> Also, there is a performance issue I just noticed with the Gmail/Gmail
> setup. When I wrote the labels thing, I had Maildir/Gmail in mind...
> 
> The thing is:
> 
> * changing labels on a Maildir is best done one message at a time, and changing
>   all labels of a message in a single write.
> 
> * changing labels on Gmail is best done one label at a time, and changing it for
>   a range of uids in a single transaction.
> 
> So, when I wrote the copymessageto_labels for GmailFolder and
> GmailMaildirFolder, I did it with those optimizations in mind.
> 
> Now, doing Gmail/Gmail, will use the wrong optimization. Fixing this will fit in
> the "big refactoring" context besides, I don't have much time, so I'll leave it
> as it is for now.

Ok.

> I'll try to document this and some other things you asked in the following days.

Yes, please. I'd even say this is the most important.

> Anyway, I resent v2 of the previous patch with the better check for label
> capabilities. I removed one warning, because it would be triggered on every
> message...
> 
> The patch is just a minimal translation from an obscure try-except idiom to a
> cleaner condition check.

Ok. I'm postponing the merge because:

1. We should still raise an exception instead of warning: if I apply the
patches, we would support more than documented and any error in the
configuration file might lead to unexpected sync.

2. I'll be more confident in merging it just after the stable is out
once the above point is addressed.

Care to send your sign-off for this topic?

Thank you!

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list