+1000 for IMAPSync.

I was never able to get doveadm sync/backup to work despite a lot of tinkering attempting to do so. Never.

I could get imapsync to work in <10m and it works incredibly well.

 

I can't say enough good things about imapsync

(And enough bad things about doveadm sync - I imagine it must work for some people, but how to do so is seemingly like witchcraft with secret incantations, potions and arcane hidden knowledge.)

 

Save yourself the agony, and try imapsync *first,* not second. :)

 


I don't have any direct answer to your question, but wanted to make sure you were aware of these tools, which are built to safely merge two IMAP mailboxes together with no loss. They might provide an alternative strategy.


Imapsync: https://github.com/imapsync/imapsync


Offlineimap: https://github.com/OfflineIMAP/offlineimap


P.