Doing that there's one issue I ran into, which is that GMail has a mail size limit of 25 MB whereas iCloud Mail only allows 20 MB, and I have a nontrivial number of emails with attachments just in between. If someone has a good solution for this other than manually removing or somehow shrinking (e.g. images) attachments, I'd be interested.
IIRC I used the imapsync --maxsize option, then hand-processed the relatively few (in my case) emails which had larger attachments. In my Google Workspace mail, I believe I searched emails using larger:19M has:attachment.
Less migrating and more syncing it to an mxroute server so I can get some space back.
The one caveat about this. Gmail has a ~2gb/day limit on transfers so it can take a while.
Absolutely, ms365 too. Definitely a worthwhile tool, and if you have a big job or do it more than once a year you should purchase it.