I want to migrate some Google Apps accounts to a local mail server. Are there any scripts available, for free or money, which do solve that problem? I will have to migrate about 30 mail accounts this way, a simple IMAP copy via my mail client won't do here.
Is this a google apps account? You can request entire mbox archives of user's email accounts.
The API: https://developers.google.com/admin-sdk/email-audit/?csw=1
Command line tool: https://code.google.com/p/google-apps-manager/
I wish this were available via Google Takeout, but it isn't.
Check out imapsync...it's like rsync, but for IMAP mailboxes. You'll need to build a text document with each user's credentials, for both their google account and the destination account.
http://imapsync.lamiral.info/