I setup a script on my Ubuntu box to backup my gmail account daily with mbsync. See http://www.chrisstreeter.com/archive/2009/04/305/gmail-imap-... It uses IMAP and stores the downloaded mail in mbox format that you can view with mutt or pine. Every so often I archive the entire backup and backup that archive so I have a snapshot of the mail.