Gmail folders always deleted/re-downloaded NOT synced?

Tom Marble tmarble at
Sun Jun 1 19:55:58 BST 2014

On 06/01/2014 12:04 PM, Eygene Ryabinkin wrote:
> Thanks, but can't reproduce it locally.  Can I ask you to run OfflineIMAP
> with flags '-d ALL -l log.txt', then to remove all log lines between one
> with "Attempting ... authentication" and "OK ... authenticated" and post
> it here (or just to me privately)?

[I sent the log to Eygene off-list]

> OK, what I see here is two folders that map to a single local one
> [...]
> So, there are 'Gmail/Associations/Breck' and '[Gmail]/Associations/Breck'.
> Could it be so that you have both Associations/Breck as the folder and
> as the label?  Or it is a bug in OfflineIMAP?  I can't see if you really
> have these two inside the LIST output, since it was trimmed, thus I need
> this information from you.

Yes BOTH appeared in the LIST output:
2014-06-01 12:07:40 DEBUG: [imap]:   07:40.13 reader < * LIST (\HasNoChildren) "/" "Gmail/Associations/Breck"\r\n
2014-06-01 12:07:40 DEBUG: [imap]:   07:40.27 reader < * LIST (\HasNoChildren) "/" "[Gmail]/Associations/Breck"\r\n

So based on this I made the following changes:

def tom_folderfilter(folder):
    if folder.find('[') >= 0: # ignore [Gmail] entries from LIST
        return False
    ic = ['Breck', 'CHI'] # try two folders now...
    return functools.reduce(f_or, [folder.find(x) >= 0 for x in ic])

def tom_nametrans(folder):
    return re.sub(r' ', r'_', folder)

def tom_reverse_nametrans(folder):
    return re.sub(r'_', r' ', folder)

And now this seems to work (both with quick = 0 and quick = -1).



More information about the OfflineIMAP-project mailing list