Gmail – How to download entire Gmail account in a format prepared to upload to another server (such as Dovecot) / email provider

gmailgmail-imapimap

I need to download an entire Gmail account such that it's in a format that's friendly for importation / upload into a Dovecot server. What's the right way to proceed with this so as to not only download all messages + attachments, but also to retain any existing "folder" structure?

Best Answer

You can refer to the official pages on how to Export your data from Gmail
as well as How to download your Google data, where you will find complete instructions on how to complete your export.

You can also follow instructions from the Migration from Gmail to Dovecot wiki page.