How to back up gmail to my computer?

15

7

I am using gmail as a part of Google Apps for Domains. I'd like to back up all my email.

I've tried setting up IMAP in Thunderbird and it works reasonably well (except it times out way too much, forcing me to help it along manually). However, I have a ton of labels, which in the IMAP land map to folders. And in Thunderbird, you have to click on each folder separately and tell it to download everything. Painful.

Is there a tool that will let me do this easier?

AngryHacker

Posted 2009-08-14T23:39:24.793

Reputation: 14 731

Which OS are you on? – None – 2009-08-14T23:47:34.420

1I am on Windows XP. – AngryHacker – 2009-08-14T23:50:03.993

+1 for XP I would never have left, but my h/w won't even run XP install :-( – Mawg says reinstate Monica – 2012-10-27T13:01:49.933

Answers

9

user4358

Posted 2009-08-14T23:39:24.793

Reputation:

1Hello, be careful with gmail backup (see my comment below!) – Erb – 2010-10-15T06:25:31.740

1Warning: many of these posts suggest using POP, which does not back up all your mail - only messages with the Inbox label. – Yang – 2011-01-04T06:02:32.550

5I'd not recommend anything that uses POP (like the first two links, and possibly the 3rd as well). When one needs to restore, a huge archive with POPped messages is not going to help a lot, and it does not include sent items. – Arjan – 2009-09-13T09:08:54.207

It's not really helpful to answer with a set of links - which of the 5 should I take now? – Frank Meulenaar – 2012-01-14T15:23:26.650

3

Most email clients when viewing over IMAP will clearly distinguish between the IMAP store and the local store.

Simply copy the messages / folders to the local storage using your email client's copy command, and it should copy the messages in the local storage.

Make sure not to move them, since this will more than likely remove them from the email server.

Edit Outlook seems to handle IMAP servers a lot better than Thunderbird does from my experience. Perhaps it would be a good idea to get a copy of Office 2003 / 2007, and work from that? (Legal copy of course :P)

All the major windows clients (Thunderbird, Outlook) will clearly differentiate between the local storage and the IMAP store. Not sure about Windows Mail or OE though.

EvilChookie

Posted 2009-08-14T23:39:24.793

Reputation: 4 519

Funny, I've always had trouble with IMAP in Outlook. (Especially as it needs a rule to copy your sent items to your Sent Items folder, which is horrible when using multiple accounts. But For Gmail, one could use the Gmail SMTP server which copies the sent items by itself.) Thunderbird has always worked great for me. – Arjan – 2009-09-13T07:40:35.123

2

TheTXI

Posted 2009-08-14T23:39:24.793

Reputation: 3 551

3

Hello, be careful with "Gmail Backup" as it has a big bug: it removes the unread status of your gmail messages ! see http://www.gmail-backup.com/lost-read-marks

– Erb – 2010-10-15T06:23:25.770

This does not work for me as it saves each individual mail as a separate .eml file. I need to be able to see the emails in an application of some sort, search through them, etc... – AngryHacker – 2009-08-15T00:13:02.497

2

Not written for backup purposes, but: see also How to Access Gmail When It’s Down at Lifehacker.

As for backing up Gmail:

When using IMAP to backup Gmail, one also needs to backup the local IMAP storage. When not doing that, then when messages get deleted on either the server or on the local machine, they will also be gone on the other machine upon the very first IMAP synchronisation. So, using IMAP by itself is not a backup. (As for actually downloading the message, ensure to disable options such as "Fetch Headers Only", and for Thunderbird see also the mail.check_all_imap_folders_for_new setting.)

When using POP (like when using getmail or fetchmail as listed in nagul's answer) then one should consider how to restore this if ever needed. POP does not know about any folder structure. Even worse: using POP you will basically download every message you ever receive. Even if you delete it on the server (like through the Gmail web site) then the local copy will still exist. If you ever need to restore then you have to go through a huge pile of messages and need to find the messages that are still of interest. Also note that using POP does not backup the Sent Items.

Arjan

Posted 2009-08-14T23:39:24.793

Reputation: 29 084

2

Would Offline GMail be sufficient?

Nick Retallack

Posted 2009-08-14T23:39:24.793

Reputation: 1 436

I guess that suffers from the same problem as IMAP: unless you backup the offline storage, anything deleted from either the server or the local machine, will be deleted from the other machine upon first synchronisation. Not a good backup then, but at least IMAP is not some proprietary format, so an IMAP storage can be restored from a real backup. (I wouldn't know what to do with a backup of the Offline Gmail storage.) – Arjan – 2009-09-13T09:12:33.967

0

A good general-purpose tool for maintaining local copies of your mail is OfflineIMAP. Here's my config file (with personal info censored) for backing up my gmail:

[general]
ui = Curses.Blinkenlights, TTY.TTYUI, Noninteractive.Basic, Noninteractive.Quiet
metadata = ~/.offlineimap
accounts = GMail
maxsyncaccounts = 1

[Account GMail]
localrepository = Gmail-local
remoterepository = Gmail-remote

[Repository Gmail-local]
type = Maildir
localfolders = ~/Mail/Gmail
sep = /

[Repository Gmail-remote]
type = Gmail
remoteuser = ********@gmail.com
remotepass = ********
holdconnectionopen = true
keepalive = 60
maxconnections = 1

Yes, unfortunately, you put your password in plaintext in the config file. There may be a better way, but I'm not paranoid enough to go looking for it.

Ryan C. Thompson

Posted 2009-08-14T23:39:24.793

Reputation: 10 085