'Save the message on the Server
This backend always assigns a new uid, so the uid arg is ignored.
This function will update the self.messagelist dict to contain
the new message after sucessfully saving it, including labels.
See folder/Base for details. Note that savemessage() does not
check against dryrun settings, so you need to ensure that
savemessage is never called in a dryrun mode.
:param rtime: A timestamp to be used as the mail date
:returns: the UID of the new message as assigned by the server. If the
message is saved, but it\'s UID can not be found, it will
return 0. If the message can\'t be written (folder is
read-only for example) it will return -1.'

def savemessage(self, uid, content, flags, rtime):

    if (not self.synclabels):
        return super(GmailFolder, self).savemessage(uid, content, flags, rtime)
    labels = set()
    for hstr in self.getmessageheaderlist(content, self.labelsheader):
        labels.update(imaputil.labels_from_header(self.labelsheader, hstr))
    ret = super(GmailFolder, self).savemessage(uid, content, flags, rtime)
    self.savemessagelabels(ret, labels)
    return ret
