Gmail Carbon Copy

Published on .

Today I’d like to introduce Gmail Carbon Copy, an application I’ve coded during the last couple of months. The latest version is stable and works, so I’m deeming it fit for public consumption.

Gmail Carbon Copy, or Gmailcc simply creates a back-up of your Gmail. It differs from existing alternatives because of two clever tricks: each mail is downloaded only once instead of once for every label while still saving the labels, and they’re stored in an actually usable, sparse Maildir format.

Gmail’s IMAP implementation is unique in that it maps labels to folders. The same mail will appear in different folders for every label attached to it. Regular IMAP clients like Thunderbird or getmail think each copy of the mail in a different folder is a new mail, and will download it again, even though it might just be a copy of a mail it downloaded earlier. Gmailcc detects “doubles” and will download each mail just once. Backups, especially the initial one, will finish much faster because of this and will take far less traffic.

Saving it in a usable Maildir format has the advantage that any regular mailserver like Courier can access your backup. It’s very practical: I’m using Gmailcc and Roundcube to access my mails on a webinterface if Gmail is down. It’s sparse because every mail is saved only once, while for every label a sizeless link is created instead of a true copy. This minimizes the space used to store the backup.

There are still some issues but it shouldn’t make your PC explode or kill your Gmail account. If you encounter bugs or would like to have features added, I encourage you to create an issue in the github repository. As always pull requests are always welcome too.

Gmail Carbon Copy is open source (C++), licensed under the MIT license and works only on Linux at this time.

David Verhasselt

Senior full-stack engineer with 5 years of experience building web applications for clients all over the world.

Interested in working together?

Find out what I can do for you or get in touch!

Like this? Sign up to get regular updates