I’ve been on a big ‘back-up my digital life kick’ these past six months, I’ve worked on implementing off-site solutions, on quick local solutions and ‘in the background’ solutions, all with various success, all with the idea of more backups are better.
To put it simple, my mantra as of late has been “Storage is cheap. Loss of data is expensive”.
One of my most ambitious back-up projects to date has been backing up my gmail account. This task has been something on my mind a fair amount lately and with the recent temporary loss of gmail accounts , I decided I should do something.
The goals for my method were the following:
- store a copy of all incoming mail (starting as of now)
- have a copy of all outgoing emails (starting as of now)
- have a copy of all mail that I have achieved to date
- have these stored, and seperated (incoming vs outgoing) in my mail appliation of choice
My mail application of choice is Thunderbird. I’m not sure if its the best client, as on quick examination it stores all the mail in a single file, which means when you back up the mailboxes through incremental backup, your not realling being that effiecient. Small concern, since the file will likely never be bigger than 7GB.
But before we get into my method, its important to explain two mail protocols; POP and IMAP. A lot of the quick google search I’ve seen for DIY backup strategies say use IMAP and Thunderbird, which is a bad idea. Why? Well to know why, you have to understand the difference between POP and IMAP.
POP VS IMAP
There are two methods for desktop email access, POP and IMAP. POP downloads your email off the server into your email client. This means if you use POP to access your email what ever you do with the messages in your mail client will not be reflected on the server. For example, if you move all your emails from mom into a folder called ‘Mom’, that folder won’t exist on the server (you won’t see the folder if you use a webpage to access your email at a later time).
IMAP is the opposite of POP. Your mail application will (always) sync with the server. If you move those messages into a folder called Mom, then when you log into the web front end, the messages will be in a folder called mom. If you delete the folder on the server, the folder will be trashed the next time you open your mail application. I’m really simplifying this, and not doing the protocol justice– but you should get the idea from this.
POP used to be more common, but, as storage got cheaper (and GMail threw down the gauntlet with 1GB of web storage), POP disappeared and IMAP became the default. To put this in perspective when I got my university account in 2000, I had 10 (maybe 25) MB of storage. If I wanted to keep my messages for any length of time, POP was necesary. Today, that same school offers several GB of space (ironically, through contracting their email service out to GMail). There is rarely any need to POP email.
Most of the sites I found online suggest that just POPing your email into Thunderbird would be an adquate back-up method. I mainly agree with this, as for backing up email, you should NEVER use IMAP. If you use IMAP and lose your mail on the server, you will lose your ‘backup’ when you open your mail application (as it will sync to the server and delete messages– the server always wins in IMAP).
Now GMail does let you pop email (and be default leaves the messages on the server), but I don’t like having POP enabled on my account. All it takes is someone to guess my password, and they can download all the email to their machine.
Parinoia is the cornerstone of security.
To get around this, I’m using a second unpublicised gmail account to store all my backups. This way I can access backups from any browser still, and also not worry about making a stupid mistake to my primary account.
You need to have two gmail accounts for this method, your primary account (email@example.com) and your back-up account, (firstname.lastname@example.org). From here on, when I say userXXX I’m refering to that account.
SEEDING THE BACKUP ACCOUNT
In the user1 account, go to settings and to do the following:
- go to Forwarding and IMAP/POP in settings
- Under Forwarding, set the forwarding address to your userbak account and the second dropdown to ‘keep GMail’s copy in the inbox’
- Under POP Download select ‘Enable POP for all mail (event for mail thats already downloaded)’
Now go to your userbak account and do the following:
- go to settings and then Accounts and Import
- you CANNOT use the Import mail and contacts option for basic gmail
- Under Check mail using POP3, add your user1 account
- set the pop server to pop.gmail.com and Port: 995
- Check off Always use a secure connection (SSL)
- Optional to check off Archive incoming messages (skip inbox), i left this uncheck as I wanted to do some filter work, and like to use my inbox as a ‘sandbox’.
At this point, you will have set up your userbak account to download a copy of all your email from your user1 account, and all new email that you recieve in user1, will automatically forward a copy to your userbak account. Copying mail through this method doesn’t lose any messages, but it takes a long time. My primary account has about 24000 messages in it (a lot of it is junk) and it took 24 hours to transfer 7000 messages between these acccounts. At this rate it should take 4 days to copy it all over.
You should also note that the SPAM fileter on the userbak account is active. After you finish copying your mail over, you should move all the SPAM in userbak to the inbox– this way you don’t lose any email by mistake.
After the copying is done:
- Remove user1 from the Check Mail Using POP3 in the userbak account
- In the userbak account, Enable POP access under Forwarding and POP/IMAP
- In user1, Disable POP access
- From this point on, all incoming mail will have a copy automatically forwarded to userbak (as you previously had set up)
Open Thunderbolt, and add userbak as a new account with POP access and in the advance settings, make sure that its set to leave all messages on the server (do this if you want to be able to access a web-based backup). Let Thunderbird start to download your mail– it’ll likely take a few hours pending on the amount of messages in your account.
So what’s do you do form here? How about setting up a way to easily flag your outgoing mail, and only download what you mostly need? These details and more will be in my next backing up GMail post.