Syncing custom tags - OfflineIMAP/offlineimap GitHub Wiki

Note: this content should be moved to the official documentation.

While offlineimap does sync the standard IMAP tags (like \\Seen, \\Answered etc.), custom tags are not synced. There is however a way to specify which additional tags should be synced for your specific situation.

In your .offlineimaprc file in the [general] section, add a line:

pythonfile=~/.offlineimap.py

containing the following code:

import offlineimap.imaputil as IU

if not hasattr(IU, 'customtagpatch'):
    IU.flagmap += [('gnus-expire', 'E'),
                   ('gnus-dormant', 'Q'),
                   ('gnus-save', 'V'),
                   ('gnus-forward', 'W')]
    IU.customtagpatch = True

This code adds 4 tags to the set of tags which will be synced and maps them to letters which will be used by the Maildir format (if applicable) and makes sure the flags are only added to the flag map once.