On Tue, 05 Jul 2011, 17:58+0100, Chris G wrote:
> I have recently moved my mail hosting, not from one ISP to another but
> from one platform to another.
> 
> As a result I need to move some IMAP mail from some local backups
> (copies made just before the move) to the new IMAP server.  How do I do
> this so that the directory structure is preserved?
> 
> To be specific I want to use mutt to copy some E-Mails from local
> maildir files (they look like Courier IMAP ones) to a remote IMAP
> server. 

Since I use offlineimap [1] with mutt instead of the built-in IMAP, a 
sort of round-about approach that comes to mind is to do the following:

1.  Set up offlineimap to sync your remote IMAP server to a brand new 
    local maildir.  
2.  Use mutt to copy (save) all the messages from the old local maildir 
    to new maildir.  
3.  Run offlineimap to sync the new maildir again, which should copy all 
    those "new" local messages to the remote server.  

Once the messages are on the remote server, you can ditch offlineimap 
and go back to whatever it was you were doing.  If anything went wrong 
you'll still have the original maildir so you can try something else.
I've successfully done this to restore mail I accidentally deleted off a 
server but still had local copies of.

Of course, it may be possible that you could simply use mutt's built-in 
IMAP to sync the new server with the old maildir, in which case you 
could skip the offlineimap sync altogether.  I've never used the 
built-in IMAP ability so I wouldn't know.

[1] http://offlineimap.org

Cheers,
Jimmy

Reply via email to