Backing up email from any IMAP server (plus: syncing and migrating)
I recently migrated email providers (several times, actually) and came across the fantastic tool mbsync. It’s included in most GNU/Linux distributions, though sometimes called by its old name, “isync”. mbsync is very powerful, it can not only sync between a remote IMAP server and e.g. a local on-disk mirror that you want to keep so you can back it up, it can also sync between two remote IMAP servers directly. Many very advanced configurations are possible from your own personal .mbsyncrc file. But since it took some time to puzzle together a good config from the semi-cryptic manpage, here are two configs I used for two typical situations. ...