Friday, 1 November 2013

Backing up gmail

Ladysolly has a problem with email on her iPhone. It works OK on the iPads, and on a computer, but the iPhone keeps asking for a Exchange password, and won't accept the correct one. She says it's not a big deal, as long as it works on her iPads, but I detected the note of terror in her voice when I suggested deleting the iPhone access and reinstalling it.

Evidently, there's a lot of important stuff in her email account. Which means that she's using it as an important database. And she doesn't have any sort of backup.

The fact that she can access it via several different routes, doesn't mean that there's more than one copy of this data. There's only one copy, and it's on a server owned by Google.

I've alsways felt that saying that you "keep something in the Cloud" actually means you "keep something on someone else's computer". And that's not safe to start with. Suppose Google decide to delete the account, because, well, any reason they fancy. It's free, so how could you complain. And I'd guess that if you actually read the Terms and Conditions, they don't make many promises about the integrity or availability of your data.

I'm guessing that loads of people are in this situation, and when they do lose all their data, all they can do is ... suffer. I've seen the suffering when someone loses all their data, and it's horrible. I used to run a Data Recovery service (no fix, no fee) and we were only successful 95% of the time.

Backup is required.

So how do you back up a Google email account? Pop and fetchmail, is how.

First you need to enable Pop on google mail. Log into your Google mail account on Google, click on the thing that's supposed to look like a gearwheel (top right) and choose "settings". Then click on "Forwarding and POP/IMAP" and click on the radio button that enables POP. And tell it to "keep Gmail's copy in the inbox". Click on "Save changes" and you're done here.

Now go to the computer that will be making the backup. If you don't have Fetchmail, then install it. I used "yum install fetchmail".  Then I created an account for ladysolly on that computer, which I don't think she'll ever use (unless Google deletes all her emails). Then, in her home directory, I created a file called .fetchmailrc in which I put:

set postmaster "drsolly"
set bouncemail
set no spambounce
set properties ""
set daemon 10
poll with proto POP3 and options no dns
user '' there with password 'ladysolly-password' is 'ladysolly' here  options ssl

and saved the file.

Then I ran

fetchmail -k

the -k means "don't delete the emails you access (although Google wouldn't allow that anyway, the way I set it up).

It's downloaded 3300 emails so far, and counting, we're only up to February 2012 so far. Looking at the subject headers, 99% of them are spam (ladysolly gives her email address out rather too freely, I think) and the rest of them are marketing offers from companies like Amazon that she has bought things from. Still, it's not for me to decide what she wants to keep; I'll just back up the whole thing, and from now on, it'll be backed up daily, because I set up a crontab

05 05 * * * fetchmail -k

No comments:

Post a Comment