emailimapdovecot

IMAP migration and changes to folder structure


I am using imapcopy on a ubuntu 14.04 server and telnet to migrate and respectively edit heavy imap inboxes accounts. I would like to flatten the folder structure, meaning that I want to select and copy all emails from all children folders into one "Import" folder.

I cant seem to be able to do just that. Any suggestions to an alternative way to do this?


Solution

  • Are you using this? https://launchpad.net/ubuntu/+source/imapcopy/1.04-1. If so, edit imaptools.pas and change the following line as shown to copy all messages to the IMPORT folder on the destination.

    Original:

    Result := Command ('APPEND '+Mailbox + Flags + ' {' + IntToStr (Length(Msg)) + '}',TRUE);
    

    New:

    Result := Command ('APPEND IMPORT' + Flags + ' {' + IntToStr (Length(Msg)) + '}',TRUE);
    

    If the IMPORT folder does not already exist you'll need to create it.

    Err := Dst.CreateMailbox ('IMPORT');
    

    Then recompile it.