I have used the following sequence after partial success with mbsync:
Perform a migration using migmail.py by @vsajip with the relevant .csv, as mentioned
After the migration, Thunderbird didn't show any folders on my opalstack
mail account, because by default it "only shows folders you are subscribed to".
Other mail apps may not have this "feature", but for Thunderbird you can do
this: Go to account settings -> server settings -> advanced, and un-check "only show
folders you are subscribed to". Alternatively, you can right-click on the
account name on the left pane, select "Subscribe...", wait for it to find all
your email folders and then subscribe to all of them or as needed.
If, like me, you tried several methods to migrate your emails and you weren't
sure if and when to delete the .mbsync folder before finally using migmail.py,
you may end up with several copies of each email. Here's what you can do:
- Go to https://github.com/quentinsf/IMAPdedup and copy imapdedup.py to your
ssh at opalstack. Then run:
python3.6 imapdedup.py -x -s imap1.de.opalstack.com -u your_username -w your_password -l > mailfolders.txt
This produced a list of folders in your mailbox. Now open mailfolders.txt and add double quotes to the start and end of every line. This will help process folder names with spaces and special characters or locales.
cat mailfolders.txt | xargs python3.6 imapdedup.py -x -s imap1.de.opalstack.com -u your_username -w your_password
You can add a -n to see a dry run before doing a real run. If you look through the output carefully, you may notice imapdedup recommending that you use -c to catch duplicate messages that may not have a message-id. Go ahead and do that:
cat mailfolders.txt | xargs python3.6 imapdedup.py -x -s imap1.de.opalstack.com -u your_username -w your_password -c
That was it! I ran this sequence for all my team's emails after I had tried other options that had
actually part-worked and it cleand up and completed the migration for us. I
seem to have the same rough number of emails (in the order of a few thousands).
To be honest, I don't really look at emails that have fallen behind the
horizon, but it's nice to know I din't lose any in the move... as far as I know!