Google graciously hosts my domain free-of-charge. The fee for upgrading my domain for more storage space is not cheap. Since my account hit 99% a few weeks ago, I had to come up with a solution. In short, I am using POP3 to bleed off my oldest emails to my iBook. Here's how I did it.
GMail's implementation of POP3 works by downloading the oldest email first. It uses the time stamp on the email, not when it hit my account. So if I took an email from 1999 and used IMAP4 to store it in 2007, it'll download with other 1999 email and not my 2007 email. Make sense? Actually this good because it assures the latest and greatest email will be in my GMail account.
I wanted to preserve the tag/folder structure I have with GMail as much as possible. I'm not replicating it exactly. Since GMail uses tags, a single email can have multiple tags making it appear to reside in several places when in fact it's a single email. On my local system I would need to store multiple copies of an email to get it to live under multiple folders. That's a little silly.
First I logged into my GMail account, clicked on "Settings", clicked on "Forwarding and POP/IMAP". Under "POP Download" I selected "Enable POP for all mail (even mail that's already been downloaded)" and told GMail to delete the copy in my GMail account. The idea here is to get email out of my GMail account and onto my local hard drive.
As many of you probably know Mac OS X is simply Unix. And Unix means fetchmail and procmail. Setting up a good .procmailrc is beyond the scope of this posting. If there's interest I will cover it later. I wrote a script to handle this for me. Some of the email I'm downloading is several years old and I've forgotten about many of the mailing lists I was once on. As I download more and more email I simply add the name of the mailing list to my script and regenerate my .procmailrc on the fly.
We're almost done. I of course had to set up my .fetchmailrc file. It's straightforward:
poll pop.gmail.com with proto POP3 and options no dns user 'name@mydomain.abc' there with password 'MyPassword' is 'local-user-name' here and wants mda "/usr/bin/procmail -d %T" options ssl no keep fetchall
In English I'm polling pop.gmail.com with my user name and password and telling fetchmail who I am on my local system and to handle my email using procmail. I need to use ssl, don't keep messages on the server, and grab it all.
But wait, do I really want to download all of my email? GMail downloads in batches. I have seen as few as less than 300 come across with one fetch and as many as over 500. I can't say for certain, but I believe GMail has a byte limit that it'll download in one fetch. This is handy because obviously I don't want to spend 3 days downloading every email in my account.
I ran this and downloaded thousands of emails to my hard drive. But I was still at 99%. What's wrong? The downloaded messages went into my Trash folder in my GMail account and have to sit there for 30 days before they're automatically deleted. Since I was at 99% and couldn't send anything, I manually deleted the Trash. Now that I'm down around 91% I no longer worry about it.
Because I'm on a Mac I have Time Machine running to backup my hard drive. Make sure the email you pull out of your GMail account is safe.
