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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Dec 2 19:20:34 GMT 2011


> Yes, please. What's make emails much better is that anybody subscribed
> can easily read & review your work. The wider audiance patches get, the
> better. :-)

OK. The patch is attached. the description is:

Fix the logic for updating maildir flags.

I noticed this failing when offlineimap and dovecot accessed the same directory.
Dovecot adds lowercase flags for keywords the IMAP clients sends it, so I had a
file that was named like

    ....:2,a

With the old logic, infostr would be set to infomatch.group(1) which was ':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


Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: update_flags.patch
Type: application/octet-stream
Size: 995 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20111202/4b12507c/attachment-0003.obj>


More information about the OfflineIMAP-project mailing list