We recently had an issue where one of our inboxes was nearly full. So we reached out and did some research to find the best method of reliably backing up a Gmail inbox and clearing it. We found that the best method is with getmail, a Linux utility that fetches mail through IMAP. It is very powerful and flexible, providing a lot of options. There are several different methods as well (outlined below).
Overall, we recommend using getmail. By trying several different approaches, getmail is by far the best. It is a little confusing at first, but not a hard pill to swallow:
How do you install getmail?
sudo apt-get install dovecot-imapd getmail4
pacman -S getmail
yum install getmail*
Here are some resources for backing up gmail with Linux:
- Matt Cutts explains how to backup gmail with getmail
- Linode documentation goes over getmail setup
- Getmail documentation
- Configuring getmail
If you don’t like getmail there are several different options out there:
- Life hacker explains how to backup gmail with fetchmail
- Periodically backing up your email with fetchmail