storing and synchronizing labels
abdo.roig at gmail.com
Wed Jul 31 20:41:49 BST 2013
> I did some research in the past few days and I feel that the cleanest
> solution would be to patch offlineimap and sup to store be able to store
> (and to sync) labels to a folder, together with the status of messages.
> Then I'd just fetch Gmail's "All messages" folder together with the
> labels and present it to sup. No more messing with individual folders,
> mapping, etc.
Well, about a year ago I wrote something close to what you propose, and I've
been using it since. I submitted a pull request to offlineimap some days ago:
The approach is to sync only the All Mail folder, and use Gmail specific IMAP
commands to fetch the labels.
Unlike what you propose, I decided to store labels inside the contents of the
message, under a header X-Keywords. The main advantages are:
* labels travel with messages if I sync them across computers. Previously I
had tried to store them in a separate database and it was a mess.
* I can see and edit labels with my email client (mu4e by the way) and sync
them back to gmail, without the need for the mail client to access an
external label database. The mail client just needs to change a line in the
Hope this helps.
More information about the OfflineIMAP-project