Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Could you explain in more detail the problem you're having, and what steps you've taken to try and solve it. Some clarity on the method you're using and why IMAP copy isn't suitable would also be useful. – Drew Khoury Aug 30 '13 at 10:25
Sorry for replying so late. The problem with Gmail is that every mail has a label, All Mail. Every mail, received and sent ones have this label. When I copy mails from a Gmail account to a regular IMAP server every mail I ever sent or received would be in my inbox. There is no way to differentiate between received and sent mails without Googles backend. – Ulf Klose Sep 12 '13 at 9:35
There is a number of mail filtering/sorting tools that can check headers and/or bodies of messages and then deliver them f.e. into the appropriate folder of the maildir. The exact solution depend on the mail software you have migrate to. – Kondybas Sep 18 '13 at 22:11
up vote 1 down vote accepted

Is this a google apps account? You can request entire mbox archives of user's email accounts.

The API:

Command line tool:

I wish this were available via Google Takeout, but it isn't.

share|improve this answer
Thanks, I will try this approach. – Ulf Klose Sep 12 '13 at 9:35
@ulf How goes the battle? – Dan Garthwaite Oct 24 '13 at 12:22

Check out'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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.