Backing up Gmail
For a while I have been trying to use Gmail as my primary email client. Online searching, no worries about the backup, tagging …but still it just doesn’t cut it – at least for me. I know people are happy with it – but I feel a bit stuck. No progress. The improvements they made so far just do not address the real problems IMO.
- You cannot filter on special headers like “Precedence” and “Delivered-To”
- You cannot filter on the virtual mailbox (firstname.lastname@example.org)
- When sending mails from a different email address the header still contains the gmail address
- Tagging (aka labeling) and spam reporting does not work from your desktop email clients
- There is no IMAP support
- No offline mails …or what do you do on a plane or train?
Besides technical reasons why implementing e.g. IMAP on top of Gmail is probably not that easy I also suspect business reasons for not improving the desktop client experience of Gmail users. Who would see the ads then? The funny thing is – I would even pay for a proper email setup with IMAP and tagging and so on. The providers I found so far did not fill this gap for me.
So because all these things I decided to move my mail back to my laptop and only use Gmail for backup purposes. So first I had to get my current mails downloaded. …and I thought that would be an easy one. This post pointed me to mpop which seems to be perfectly suited for the job. Unfortunately it is not available through fink yet. But a simple standard install works fine.
./configure --prefix=/sw make sudo make install
The configuration is easy
# defaults defaults tls on # gmail account gmail host pop.gmail.com user myaccount password myaccountpassword keep on only_new off tls_starttls off delivery mbox ~/Backupemail@example.com # Set a default account account default : gmail
Now if you start it up it works fine. Of course given that you have enable the pop3 access for all mails in the Gmail settings. For some reason Google hands out my 4000 mails in batches of 300-600 mails. So you have to run mpop over and over again. Unfortunately after re-running mpop a couple of times I always hit the following problem.
... retrieving message 347 of 605 (4.69 KB): 100% retrieving message 348 of 605 (3.48 MB): 100% retrieving message 349 of 605 (7.60 MB): 100% mpop: command RETR 350 failed mpop: POP3 server message: -ERR [SYS/TEMP] Temporary system problem. Please try again later. mpop: error during mail retrieval (account default from .mpop.conf)
I am not absolutely sure whether in the end it was really just a temporary problem or not (I have seen this over a couple of days). Maybe the too frequent logins were a problem – no idea. In the end looping with a delay did the trick for me
#!/bin/sh while [ false ] ; do echo "retrieving..." mpop -C ~/.mpop.conf sleep 300 done
Now comes the really fishy part. My Gmail account lists around 4000 mails but the downloaded mbox file only contains about 3700 mails. WTF? Lock in alarm – no thanks!