Maildir -> Restore to IMAP server
plutocrat at gmail.com
Mon Dec 22 09:23:04 GMT 2014
Perhaps I misunderstood how offlineimap works, however I now find myself in a hole. I used offlineimap to create a maildir copy of an email account, joe at company.com, as I needed to move the account to a new server. For reasons too long to go into here I was forced to make a local copy as the email provider forced me to delete the account on one account, before moving it to a new account. This meant of course, I couldn't do an IMAP sync between two live accounts, as joe at company.com would only ever exist on one server.
The sync from IMAP -> maildir went as expected. Actually pretty quick for 1.8 Gb of mail!
I deleted the account from the old server and set it up on the new server. I changed the DNS settings and logged into the webmail interface: the new account was empty as expected. I ran offlineimap again using the same .offlineimaprc file, and got a bunch of errors:
UID validity problem for folder INBOX.Spam (repo Remote) (saved 1212983672; got 1419237195); skipping it. Please see FAQ and manual on how to handle this.
So I looked in the FAQ and saw that the answer lay in the cached information. However the solution is to delete the contents of the maildir and cache, which is not what I want to do as this is now the only copy of the mail!
I thought I might be able to address this by editing the saved UIDs. I tried changing the UID in .offlineimap/Repository-Remote/FolderValidity/INBOX.Spam from the incorrect one to the correct one (ie 1212983672 to 1419237195). However, running this sync now deletes the mails in the maildir copy, whereas I thought it would sync them back to the server. So it appears to be syncing from the empty server copy to the full local copy. Hardly bidirectional sync!
So ... what is the correct way to get these mails from the Local maildir copy into the new IMAP account? The account owner is standing behind me tapping his foot, so I need to figure it out swiftly!
Is there a way to force the sync? Is there a way to specify the direction of the sync? What have I mis-understood?
More information about the OfflineIMAP-project