[PATCH] Make flags a set rather than a list

Sebastian Spaeth Sebastian at SSpaeth.de
Wed Aug 17 10:39:03 UTC 2011


On Tue, 16 Aug 2011 11:39:00 -0400, Dan Christensen <jdc at uwo.ca> wrote:
> The hack I use just monkeypatches the flagmap in .offlineimap.py:
> 
> import offlineimap.imaputil as IU
> if not hasattr(IU, 'monkeypatchdone'):
>     IU.flagmap += [('gnus-expire','E'),
>                    ('gnus-dormant', 'Q'),
>                    ('gnus-save', 'V'),
>                    ('gnus-forward', 'W')]
>     IU.monkeypatchdone = True
> 
> I think this will still work, right?

Sure, no changes there.
 
> I agree that in the IMAP to IMAP case, it is odd that the flags 
> are converted twice, resulting in no conversion, so the flagmap
> isn't really needed.  It would be better if the flagmap wasn't
> used at all in this case, so it wouldn't need to be monkeypatched
> to handle more general flags.

IMAP<->IMAP has been tacked onto a system devised to sync
IMAP<->Maildir, and while it seems to work reasonably, the design still
shows through.

I plan to promote the use of the sqlite status cache more, and to store
the IMAP flags directly in that data base (together with the UID
mapping). So, the flagmap wouldn't be used in that case. Anyway, I doubt
it hurts performance. And as Vincent has said, universally syncing ALL
flags can lead to data loss if we are not careful and check for
PERMANENTFLAGS etc.

So exanding the number of flags synced, will likely be happening only
after the redesign to cache flags is finished and proves to be solid.

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/offlineimap-project/attachments/20110817/005ca883/attachment-0001.pgp>


More information about the OfflineIMAP-project mailing list