OfflineIMAP/offlineimap

changing nametrans on a local folder invalidates all uids.

Open

#411 opened on Nov 28, 2016

View on GitHub
 (17 comments) (0 reactions) (0 assignees)Python (1,765 stars) (373 forks)batch import
enhancementgood first issueneed contributor!

Description

Local Maildir folders use the visiblename for computing their md5 hash. See here. In case there is a local nametrans, this is the folder name translated to remote, but with local separator.

This md5 hash is embedded in the maildir files. Additionally, when copying messages to a remote, it is checked whether the message md5 coincides with the actual folder md5. If not, the local uid is made negative, which means the message will get reuploaded, and assigned a new uid on the remote. See this.

Since this has to do with uid validity, which is a remote thing, It probably makes sense to use the md5 hash of the remote folder name.

However, it has unexpected consequences. Changing the local nametrans will invalidate all uids and reupload all messages. This might happen when a user with a partial nametrans only on the remote, adds a local one to have back&forth consistency. The fact that this invalidates all uids is quite unexpected.

I'm not sure what are the options here. Since apparently there has already been a md5 hash migration, we could probably do another one and transition hashes to local folder name.

Contributor guide