Windows operating system offers various applications, like Thunderbird, that you can use to backup your Gmail account. Linux operating systems also support Thunderbird which users can use for backing up their email accounts. However, there is a better alternative known as Getmail. Getmail is compatible with all Linux versions. It stores the gmail account backup in one mbox file.
Ubuntu Linux users can use Getmail by installing it from the Ubuntu Software Center. Other Linux users can download Getmail from the official website. This tutorial will give the steps to install Getmail in Ubuntu and use it for backing up your Gmail account.
- Step 1: Launch the Ubuntu Software Center using the icon in the Unity bar
- Step 2: Now type Getmail, when the window appears, in the search field
- Step 3: Select the Mail Retriever from the search results
- Step 4: Click Install. An ‘Authenticate’ dialog box should appear now, prompting for your system’s password.
- Step 5: Type in the password and click the ‘Authenticate’ button.
When the installation is over
Creating a configuration directory
A configuration directory should be created to store the mbox file. So you should do this before you start using Getmail. You can do this using the Terminal.
- Step 1: Press Ctrl+Alt+T to open the Terminal window
- Step 2: Type the following command at the prompt without quotes – “mkdir –m 0700 $HOME/.getmail” This will create the default configuration directory.
- Now you have to create a directory for the mbox file to store the messages in your Gmail account. To do this, type the following command without the quotes – “mkdir –m 0700 $HOME/new-folder”
The file will be named ‘new-folder’. You can give any name of your preference for the directory by giving it at the end of the command above. The $HOME refers to your home directory which can be /home/.
Creating the mbox file
Now you need to create the mbox file. As Getmail does not create this file automatically, you have to do it from the terminal.
- Step 1: Type the command that follows, in the terminal without quotes: “touch ~/new-folder/gmail-backup.mbox”
The ‘~’ also refers to your home directory, just like $HOME.
Now you need to create a configuration file for Getmail. You can do this with a text editor.
Creating a configuration file
- Step 1: Open gedit (a text editor) and copy the following text
type = SimplePOP3SSLRetriever
server = pop.gmail.com
username = firstname.lastname@example.org
password = yourpassword
type = Mboxrd
path = ~/new-folder/gmail-backup.mbox
verbose = 2
message_log = ~/.getmail/gmail.log
- Step 2: Now change the username and password above for your username and password. Don’t forget to change the name of the configuration directory. Here it is new-folder. Also make sure that the path is correct in the destination portion of the text above.
- Step 3: Click ‘Save As’ and enter “.getmail/getmailrc” in the ‘Name’ field
- Step 4: Save the file to the configuration directory that you created earlier by clicking ‘Save’ button
- Step 5: Close the text editor and go back to the Terminal window
- Step 6: Now type ‘getmail’ in the prompt without the quotes and hit Enter. Now you have to wait till Getmail finishes downloading files from your Gmail account.
- Step 7: Exit the Terminal once Getmail finishes by closing the window with Close option in File menu
The messages in your Gmail account have been successfully saved into the mbox file that you created. You can import this file using various applications including Thunderbird import add-on. This technique may seem advanced or complicated, but you will get used to it once you do it yourself.