Thanks Paul and Greg for the advice on backing up my GMail account. Although fetchmail seems to work for some users, there are a couple of easier to use scripts out there.
Paul pointed me at Matt Cutts’ great blog post about using the getmail script to archive GMail.
Greg pointed me at libgmail which comes with some simple driver scripts to download all your content. You can get it from the sourceforge.net page, and read more on the libgmail author’s website.
I’m running a big batch getmail run now, and putting all the messages in MailDir format. The thing that I’m actually looking for is a way to preserve GMail’s label structure using hard or soft links in a MailDir-like format, for easy searching. I suspect that libgmail will allow this, but I haven’t dug into it enough to know for sure.