Download all mail messages from Gmail including Sent folder items

How can I download all the messages from a Gmail account, including the Sent folder items, when a normal POP fetch will only grab the inbox items?

My wife recently died, and she gave me access to her Gmail account. While I'm not sure whether or not I want to read the messages in there, I do want to make a backup copy of both the sent and received messages. Ideally, the backup copy would be accessible to me offline, though this is not strictly necessary.

I could grab the inbox via POP3, but that wouldn't get me the sent messages. I have desktops running Windows, Mac OS X, and Linux.

I have legal access to the account and I'm not interested in any future emails, only in the current state of her inbox.


You can setup an email client to download the entire contents of the account including sent mails if you configure IMAP access. The following settings work for me in Thunderbird although you can probably use any standard email client that you prefer.

Server: imap.googlemail.com or imap.gmail.com
Port: 993
Security: SSL/TLS
Authentication: Normal Password

Once you have downloaded the contents of the inbox you can then save and backup the contents of that mailbox by using the appropriate feature in the email client.

You will also want to check Settings->Labels and ensure all labels have "Show in IMAP" selected (by default, Chats are not).

Good luck to you and sorry for your loss.


I'm very sorry to hear about your wife.

I just wanted to add, you might want to download other data other than Gmail, if she used other Google services. See the "Google Takeout" project here:

https://www.google.com/takeout/

MakeUseOf just happened to post a tutorial on Google Takeout and IMAP backups recently.


This does not apply to free Gmail accounts, but is worth mentioning for Google Apps accounts (the paid kind):

The Google Apps Email Audit API lets you request a GPG encrypted export in mbox* format of a complete user mailbox or a partial export by date or search query. There's a command line tool called gam, which makes this as easy as:

gam audit export request <user>                  # returns a request_id
gam audit export status                          # until status = COMPLETE
gam audit export download <user> <request_id>

You'll also need to generate and upload a GPG key to Google Apps prior to this (and decrypt the downloaded files with this key afterwards).

* Supported by almost all email clients


First, my condolences.

As everyone has (correctly) said, you want to use IMAP.

For backup, I'd personally use a non-GUI email client though. This will make it easier to backup. And with IMAP, you can still use other clients, like Thunderbird, if you want them to be easier to read.

If I was in your situation, I'd use Fetchmail on Cygwin. Luckily enough, there is already written a tutorial for this at Lifehacker.


Use IMAP4, it will allow browsing messages directly on the server, as well as copying them out. Practically any desktop IMAP client will allow you to mark all messages and drag them into a local folder, or into your IMAP mailbox. (At various occassions I've tested Thunderbird, Evolution, mutt, Windows [Live] Mail, Outlook, Eudora, and Outlook Express.)

Batch downloads can be done using getmail or OfflineIMAP, on Linux or OS X.

(By the way, the custom POP3 server used by Gmail does, in fact, include sent messages, although it has other limits.)