What does HackerNews think of lieer?
Fast email-fetching and sending and two-way tag synchronization between notmuch and GMail
For gmail you can use lieer to pull everything https://github.com/gauteh/lieer (tho it can take hours to pull everything). Fastmail has a similar tool https://github.com/elizagamedev/mujmap
If you unpack tour mbox into maildir then you can import that too into notmuch
After everything is in notmuch you can easily push your mail to fastmail with isync/mbsync https://isync.sourceforge.io/
As a bonus point you now also have a easily updatable local backup of your e-mails.
[1]: https://notmuchmail.org/ [2]: https://github.com/gauteh/lieer
I realized that I was just reading about GMail backups a few days. Here are some repos that I happened to star on GH.
* https://github.com/gauteh/lieer
* https://github.com/imapsync/imapsync
* https://github.com/joeyates/imap-backup
It uses Google's API to fetch and send e-mails, and is quite performant.
If any Googler is reading this, why oh why is muting not part of the API?