Tuesday, February 9, 2010

How To Make a Local Backup of Your Email

Web-based e-mail services like Gmail, Yahoo Mail or Windows Live Mail are great for their access-anywhere capabilities.

The ease and simplicity of checking your mail in a browser have caused many of us to ditch the desktop client in favor of a web-based interface. It's one less application to have running and, in the case of [http://mail.google.com/ Google's Gmail], the search capabilities and conversation threading blow desktop apps out of the water.

However, using a service like Gmail means you don't have a local backup of your e-mail like you would if you were using a desktop client. Naturally, that doesn't mean you can't store backups of your e-mail on your local machine. It requires a bit of work to set up, but once you do, you'll be able to enjoy the goodness of Gmail's web interface worry-free.

''This page is a '''wiki'''. Got extra advice? Log in and add it.

Other pages in this series need your help:''

* [[Make a Local Backup Of Your Yahoo Mail Account]]
* [[Make a Local Backup Of Your Hotmail Account]]

==Backup Gmail Using a Desktop Client==

All the major operating systems ship with a built in e-mail client. Some are better than others, but all of them can connect to your Gmail account and download your messages to create a local copy of your mailbox.

Beware that some of these apps may store mail in funky proprietary formats (Apple Mail, Outlook, we're looking at you here) rather than industry standard formats like .mbox. To guarantee cross platform compatibility, we recommend the [http://www.mozilla.com/en-US/thunderbird/ Mozilla Thunderbird] client. Thunderbird 2.0 even offers a handy one-click set up for accessing Gmail.

First, you'll need to futz with Gmail's settings.


===Set Up Gmail & Thunderbird===

[[Image:Thunderbird-gmail.jpg|thumb|200px|The unofficial logo of your latest desktop hack]]
'''Step 1.''' Go to the Gmail web interface and click the Settings link at the top right corner of the page. Look for the "Forwarding and POP/IMAP" tab and click the link.

'''Step 2.''' Now you need to enable either POP or IMAP. For most people, POP will work just fine and it's the simpler of the two. Just select the "Enable POP for all mail" option. You'll also notice that you can control what Gmail does when your desktop client connects under the "When messages are accessed with POP" setting. Choose "keep Gmail's copy in the Inbox" since we're just using POP for backup purposes.

'''Step 3.''' Now startup Thunderbird, enter your username (the bit before @gmail.com in your e-mail address) and Google password. Thunderbird will begin downloading your e-mail, creating a local backup. There's no need to mess with Thunderbird's settings or since you're just doing this for backup purposes.

'''Tip:''' Remember to open Thunderbird periodically so that your mail gets backed up.

'''Tip:''' Make a backup of your Google Calender as well using the [http://blog.wired.com/monkeybites/2007/06/mozilla-sunbird.html two-way sync add-on for Mozilla Sunbird].

'''Tip:''' Make Thunderbird look like a native Apple app by installing REO-2007's [http://reo-2007.deviantart.com/art/Mac-OS-X-Leopard-Mail-1-3-72625408 Leopard Mail skin].

While this method will work and is definitely the easiest for most people, there are some drawbacks. The most obvious is that the backup doesn't include your sent mail. If you're looking for a way to improve your backups and automate the process (and you don't mind a little command line tinkering), read on.

The old Eudora 7 works great for this. I have just migrated it to Vista and though it has some quirks it gives me access to all my emails since 1999 with several ISP's. I use Gmail on the web from other computers but work with my mail on Eudora. I am considering migrating to Eudora 8 based on Thunderbird code but I have read some disturbing reviews.

==Backup Gmail Using Getmail==

Getmail is an open source Python program that can backup your Gmail account. [http://pyropus.ca/software/getmail/ Getmail] will work on any *nix system, including OS X, and even Windows as long as you have [http://cygwin.com/ Cygwin] installed.


===Installing Getmail===

Ubuntu users have it easy, since Getmail is in the Ubuntu repositories.

For other operating systems, you can either add the repository to aptitude or you can compile from the source like so:

Download Getmail, then open a terminal windows and type:

tar xzvf getmail*.tar.gz
cd (the directory that was created)
sudo python setup.py install



===Setting Up Getmail===

Now you just need a configuration file to tell Getmail how to connect to Gmail. There are a ton of [http://pyropus.ca/software/getmail/getmailrc-examples sample configuration files] on the Getmail site, but here's one that works well with Gmail. Create a file at ~/.getmail/getmail.gmail and put the following text in it:


[retriever]
type = SimplePOP3SSLRetriever
server = pop.gmail.com
username = yourname@gmail.com
password = yourpassword

[destination]
type = Mboxrd
path = ~/gmail-archive/gmail-backup.mbox

[options]
verbose = 2
message_log = ~/.getmail/gmail.log


Getmail won't create the mbox file, so before we get started, create a new empty file called gmail-archive.mbox in the gmail-archive folder of your home directory (or where ever you choose to store it). From the command line this will do the trick: touch ~/gmail-archive/gmail-backup.mbox


===Running Getmail===

You have everything set up, so it's time to actually make the backup. Fire up a terminal window and enter the following line:

getmail -r ~/.getmail/getmail.gmail

You should see a long string of messages begin printing out as Getmail starts grabbing the contents of your Gmail account. If the script stops, fear not -- Google has some limits on how many messages can be retrieved at one time. Just run the above command again the Getmail will pick up where it left off. See [http://pyropus.ca/software/getmail/faq.html#faq-notabug-gmail-bug Getmail's documentation] for more about this "cutoff" issue.

Now you have an mbox-formatted local backup of your Gmail account and you can access it with any e-mail client that understands mbox files, which is pretty much everything except Microsoft Outlook.

To automate this process, just create a shell script and attach it to a cron job that runs once a day or however often you feel is necessary.


==Backup Using Fetchmail==

Backing up using [http://fetchmail.berlios.de/index.html Fetchmail] is probably the most difficult and arcane option of the bunch, but if you're looking for a weekend project and enjoy tinkering with the command line, Fetchmail can create backups of your Gmail account.

Have a read through the Fetchmail documentation to see how you need to set things up.

Also check out Lifehacker's excellent [http://lifehacker.com/software/gmail/geek-to-live--back-up-gmail-with-fetchmail-235207.php tutorial on Fetchmail]. It's written for Windows users running Fetchmail under Cygwin, so if you're on a *nix system just ignore the Cygwin-specific elements.


== In the Future ==
{{#shtml:Template:IntelLogoRight}}
Online sites businesses often depend on your eyeballs hitting their web pages. So it would go without saying that making your data portable doesn't seem to be in the best interests of the services you use online. After all, how are these companies going to keep you coming back?

However, the ethics of that business model is in question. In order to make their sites compelling and competitive, services like Gmail or Yahoo's mail service are allowing you to import and export your data. Google has even formed a [http://www.dataliberation.org/ Data Liberation task force] which aims to make all of your data on its sites portable. Its message is clear: In the future, your contacts, your e-mail messages, your data are yours to keep and use wherever you want to.
By Banta

No comments:

Post a Comment

Tuesday, February 9, 2010

How To Make a Local Backup of Your Email

Web-based e-mail services like Gmail, Yahoo Mail or Windows Live Mail are great for their access-anywhere capabilities.

The ease and simplicity of checking your mail in a browser have caused many of us to ditch the desktop client in favor of a web-based interface. It's one less application to have running and, in the case of [http://mail.google.com/ Google's Gmail], the search capabilities and conversation threading blow desktop apps out of the water.

However, using a service like Gmail means you don't have a local backup of your e-mail like you would if you were using a desktop client. Naturally, that doesn't mean you can't store backups of your e-mail on your local machine. It requires a bit of work to set up, but once you do, you'll be able to enjoy the goodness of Gmail's web interface worry-free.

''This page is a '''wiki'''. Got extra advice? Log in and add it.

Other pages in this series need your help:''

* [[Make a Local Backup Of Your Yahoo Mail Account]]
* [[Make a Local Backup Of Your Hotmail Account]]

==Backup Gmail Using a Desktop Client==

All the major operating systems ship with a built in e-mail client. Some are better than others, but all of them can connect to your Gmail account and download your messages to create a local copy of your mailbox.

Beware that some of these apps may store mail in funky proprietary formats (Apple Mail, Outlook, we're looking at you here) rather than industry standard formats like .mbox. To guarantee cross platform compatibility, we recommend the [http://www.mozilla.com/en-US/thunderbird/ Mozilla Thunderbird] client. Thunderbird 2.0 even offers a handy one-click set up for accessing Gmail.

First, you'll need to futz with Gmail's settings.


===Set Up Gmail & Thunderbird===

[[Image:Thunderbird-gmail.jpg|thumb|200px|The unofficial logo of your latest desktop hack]]
'''Step 1.''' Go to the Gmail web interface and click the Settings link at the top right corner of the page. Look for the "Forwarding and POP/IMAP" tab and click the link.

'''Step 2.''' Now you need to enable either POP or IMAP. For most people, POP will work just fine and it's the simpler of the two. Just select the "Enable POP for all mail" option. You'll also notice that you can control what Gmail does when your desktop client connects under the "When messages are accessed with POP" setting. Choose "keep Gmail's copy in the Inbox" since we're just using POP for backup purposes.

'''Step 3.''' Now startup Thunderbird, enter your username (the bit before @gmail.com in your e-mail address) and Google password. Thunderbird will begin downloading your e-mail, creating a local backup. There's no need to mess with Thunderbird's settings or since you're just doing this for backup purposes.

'''Tip:''' Remember to open Thunderbird periodically so that your mail gets backed up.

'''Tip:''' Make a backup of your Google Calender as well using the [http://blog.wired.com/monkeybites/2007/06/mozilla-sunbird.html two-way sync add-on for Mozilla Sunbird].

'''Tip:''' Make Thunderbird look like a native Apple app by installing REO-2007's [http://reo-2007.deviantart.com/art/Mac-OS-X-Leopard-Mail-1-3-72625408 Leopard Mail skin].

While this method will work and is definitely the easiest for most people, there are some drawbacks. The most obvious is that the backup doesn't include your sent mail. If you're looking for a way to improve your backups and automate the process (and you don't mind a little command line tinkering), read on.

The old Eudora 7 works great for this. I have just migrated it to Vista and though it has some quirks it gives me access to all my emails since 1999 with several ISP's. I use Gmail on the web from other computers but work with my mail on Eudora. I am considering migrating to Eudora 8 based on Thunderbird code but I have read some disturbing reviews.

==Backup Gmail Using Getmail==

Getmail is an open source Python program that can backup your Gmail account. [http://pyropus.ca/software/getmail/ Getmail] will work on any *nix system, including OS X, and even Windows as long as you have [http://cygwin.com/ Cygwin] installed.


===Installing Getmail===

Ubuntu users have it easy, since Getmail is in the Ubuntu repositories.

For other operating systems, you can either add the repository to aptitude or you can compile from the source like so:

Download Getmail, then open a terminal windows and type:

tar xzvf getmail*.tar.gz
cd (the directory that was created)
sudo python setup.py install



===Setting Up Getmail===

Now you just need a configuration file to tell Getmail how to connect to Gmail. There are a ton of [http://pyropus.ca/software/getmail/getmailrc-examples sample configuration files] on the Getmail site, but here's one that works well with Gmail. Create a file at ~/.getmail/getmail.gmail and put the following text in it:


[retriever]
type = SimplePOP3SSLRetriever
server = pop.gmail.com
username = yourname@gmail.com
password = yourpassword

[destination]
type = Mboxrd
path = ~/gmail-archive/gmail-backup.mbox

[options]
verbose = 2
message_log = ~/.getmail/gmail.log


Getmail won't create the mbox file, so before we get started, create a new empty file called gmail-archive.mbox in the gmail-archive folder of your home directory (or where ever you choose to store it). From the command line this will do the trick: touch ~/gmail-archive/gmail-backup.mbox


===Running Getmail===

You have everything set up, so it's time to actually make the backup. Fire up a terminal window and enter the following line:

getmail -r ~/.getmail/getmail.gmail

You should see a long string of messages begin printing out as Getmail starts grabbing the contents of your Gmail account. If the script stops, fear not -- Google has some limits on how many messages can be retrieved at one time. Just run the above command again the Getmail will pick up where it left off. See [http://pyropus.ca/software/getmail/faq.html#faq-notabug-gmail-bug Getmail's documentation] for more about this "cutoff" issue.

Now you have an mbox-formatted local backup of your Gmail account and you can access it with any e-mail client that understands mbox files, which is pretty much everything except Microsoft Outlook.

To automate this process, just create a shell script and attach it to a cron job that runs once a day or however often you feel is necessary.


==Backup Using Fetchmail==

Backing up using [http://fetchmail.berlios.de/index.html Fetchmail] is probably the most difficult and arcane option of the bunch, but if you're looking for a weekend project and enjoy tinkering with the command line, Fetchmail can create backups of your Gmail account.

Have a read through the Fetchmail documentation to see how you need to set things up.

Also check out Lifehacker's excellent [http://lifehacker.com/software/gmail/geek-to-live--back-up-gmail-with-fetchmail-235207.php tutorial on Fetchmail]. It's written for Windows users running Fetchmail under Cygwin, so if you're on a *nix system just ignore the Cygwin-specific elements.


== In the Future ==
{{#shtml:Template:IntelLogoRight}}
Online sites businesses often depend on your eyeballs hitting their web pages. So it would go without saying that making your data portable doesn't seem to be in the best interests of the services you use online. After all, how are these companies going to keep you coming back?

However, the ethics of that business model is in question. In order to make their sites compelling and competitive, services like Gmail or Yahoo's mail service are allowing you to import and export your data. Google has even formed a [http://www.dataliberation.org/ Data Liberation task force] which aims to make all of your data on its sites portable. Its message is clear: In the future, your contacts, your e-mail messages, your data are yours to keep and use wherever you want to.
By Banta

No comments:

Post a Comment