[patch] Re: Fix the logic for updating maildir flags.

Sebastian Spaeth Sebastian at SSpaeth.de
Fri Jan 6 10:29:21 GMT 2012


On Fri, 2 Dec 2011 14:20:34 -0500, Rafael EspĂ­ndola wrote:
>     ....:2,a
...
> We would then remove the '2,[A-Z]*' leaving only the 'a'. leaving us in the end
> with a new file named
>     .....:a2,....

> If the old flags were in [A-Z], we should completly strip them. I looks like
> the code intent was to merge them. That is what this change implements. We
> convert the old flags into a set and merge that with the incoming flags.
> 
> After this change, the above case produces a file named
>     .......:2,...a


Hi Rafael,

thanks for the patch, and sorry for not getting back to this earlier. I
am pretty busy and I am still busy debugging the darned IMAP<->IMAP
corruption that leads to constant up/downloads...

A resulting file name of .....:a2,.... is clearly wrong, so there is
some room for improvement (and I will look into fixing this
today). However, your fix is not right either. THe code is not intended
to merge existing flags with, but to replace existing flags with the
handed in parameter "flags" (which is a set of letters). It can well be
used to remove an existing flag, so we don't want merging.

The intended current behavior would be to - you won't like to hear that
- remove the custom "a" flag, as it's not part of the remote flag set,
and thus should be removed.

Now the question is, how should we handle custom Maildir flags that
Offlineimap should not touch? We could implement a logic which would
leave lower case letters unmodified. It would not be the cleanest of all
solutions, but at least it would help in the popular dovecot case.

The question is, why would you expect that an IMAP sync tool that
includes support for standard flags, honor custom flags that only exist
on one side of the syncing side?

Hope that answers some questions, looking forward to your feedback.
Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20120106/acd4d20f/attachment.sig>


More information about the OfflineIMAP-project mailing list