On 17.06.23, Oswald Buddenhagen wrote:
On Fri, Jun 23, 2017 at 07:26:12AM -0400, Philip DeBoer wrote:
What would be the main challenges in adding support for custom flags?
Would they be difficult to fetch? Has anyone tried to add them?

well, it's work, and there are interoperability constraints.
there was a cross-project thread back in december, but i dropped the
ball.

OK, those aren't fundamental architecture issues then. So what would be the 
steps? We can use the offlineimap approach as an example.

Let's start simple: assume static labels.
* Ask google for the labels of a message. This is documented at 
https://developers.google.com/gmail/imap/imap-extensions. It should be possible 
to download labels for multiple messages (eg, whole mailbox) at once.
* Define a new internal header, like X-Keywords (or X-GM-LABELS). Populate and 
save this when writing messages to disk.
* Only download the All Mail folder, avoiding duplicates. Let an auxiliary 
program (eg, mu) construct the mailboxes by searching on our new X-Keywords.

Then allow for labels that change:
* On syncing, get all labels for all messages. Compare to the X-Keywords on 
disk and see if any have changed on the remote end.
 This step requires matching up the messages, presumably uid. Will this be 
fast? Does mbsync have a database or hashtable?
* When changing the label locally, submit this information to gmail using the 
STORE command.

Do you have a good strategy for testing during development? Are there other 
IMAP configurations besides google that we need to avoid mangling as we add new 
functionality for this specific use case?

Does this seem like a feasible approach to you? You mentioned that this came up 
in December --- is there a thread that might have additional ideas to consider?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to