syncing custom IMAP flags

Nicolas Sebrecht nicolas.s-dev at
Sat Dec 4 11:45:57 GMT 2010

[ Sorry for this late answer. ]

On Sun, Nov 21, 2010 at 04:36:09PM -0500, Dan Christensen wrote:
> Nicolas Sebrecht <nicolas.s-dev at> writes:
> > On Sat, Nov 20, 2010 at 12:39:29PM -0500, Dan Christensen wrote:
> >
> >> Alternatively, could offlineimap handle the IMAP --> IMAP case
> >> separately and simply copy the flags as is?
> >
> > Why not. I didn't look at the code (and don't know enough myself too) to
> > know if it is reliable but I may merge a seperated well-tested patch for
> > this case.
> The more I think about it, that stranger it must seem to the user to add
> a table like the above when they are syncing IMAP to IMAP, since the
> single-character flags are just used internally by offlineimap.  So no
> matter *what* characters are there, as long as they are consistent from
> run to run and don't overlap standard characters, the sync should work
> fine.  So why does the user have to specify those characters?

You give the answer if your previous sentence. How could we know if
extra flags are consistent? Force users to add extra flags themselves is
a way to prevent from odd breaks and prevent users. Supporting extra
flags is not that trivial so users have to know what they are doing.

> I'm guessing those characters are stored in the local cache.  If instead
> we were simply able to store the full custom flag name, the table
> wouldn't be needed.  I don't know anything about the format of the local
> cache, but if it could be easily extended to handle strings instead of
> characters, that would be great.  Then the flagsimap2maildir and reverse
> functions could be changed so that when a custom flag isn't in the
> table, they return it unchanged.
> If changing the local storage format would be hard, this could be done
> as part of the migration to a database.

We are not ready for a migration even it is good to have this in mind.
Also, I don't see the database as the default format for now. We would
rather offer an alternative from the current format.

> Note that it still might make sense to provide the user the ability to
> add extra flag mappings like above, for those who are doing imap to
> maildir syncs.

Nicolas Sebrecht

More information about the OfflineIMAP-project mailing list