Make GmailFolder sync GMail labels
When synclabels config flag is set to "yes" for the GMail repo, offlineimap fetches the message labels along with the messages, and embeds them into the body under the header X-Keywords (or whatever 'labelsheader' was set to), as a comma separated list. It also adds an extra pass to savemessageto, that performs label synchronization on existing messages from GMail to local, the same way it is done with flags. We also introduce GmailMaildir repository that adds functionality to change message labels. It keeps track of messages modification time, so one can quickly detect when the labels may have changed. Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:

committed by
Eygene Ryabinkin

parent
9319ae212b
commit
0e4afa9132
@ -39,6 +39,16 @@ def dequote(string):
|
||||
string = string.replace('\\\\', '\\')
|
||||
return string
|
||||
|
||||
def quote(string):
|
||||
"""Takes an unquoted string and quotes it.
|
||||
|
||||
It only adds double quotes. This function does NOT consider
|
||||
parenthised lists to be quoted.
|
||||
"""
|
||||
string = string.replace('"', '\\"')
|
||||
string = string.replace('\\', '\\\\')
|
||||
return '"%s"' % string
|
||||
|
||||
def flagsplit(string):
|
||||
"""Converts a string of IMAP flags to a list
|
||||
|
||||
|
Reference in New Issue
Block a user