A few words of thanks would be greatly appreciated.

Archiving your GMail box

GMail services are very nice, but if you lose your GMail account,then you will be in serious trouble.

Note that: It is better to make a backup of your data.

Here is a program that can download and archive all your emails in your GMail (inbox, archived and sent (including attachments), with the exception of spam folder).


  • Have a GMail account with IMAP enabled in the configuration
  • Have Python 2.5 installed.

Getting started

  • Go to this link
  • Save the program into a Python file and run it with Python.
  • Enter login and password, and wait.


  • You'll get a file: yourlogin.mbox.
  • This is a standard mailbox file that can be opened with almost all email client software.

Original FAQ by Sebsauvage on CCM!

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Archiving your GMail box », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!