Over the last years I accumulated quiet a bit of mail in Gmail. It works, and I find it very inspiring to see its features grow while I keep all my data. But I also grew worried: What would happen if my mail should go away? I have paid google exactly zero for keeping all my email. There would be nothing I could do.

Turns out that it is possible to make a copy. Googles own Matt Cutts described it well

And it would do so repeatedly with the same number. I assumed that something had gone awry with those mails. After pretending that the mail already had been retrieved via the oldmail-imap file getmail soldiered on.

Tragically at some point my connection went away. I had downloaded around 120,000 mails during that session.
Getmail updates the oldmail-imap file only when done (or cancelled via ctrl-C). So the next time it started I went to download the same mails again.

Even with that glitch things worked out. And I feel pretty good about having a copy of my mail now.

Since more than 25 years I write computer programs. Writing some information to a file for later use is a very common thing. It worked (most of the time). But it never felt right. Common up with a format, creating a writer and a parser. All that can be done. Rather mundane. Finally I switched to using sqlite for this kind of thing. And this feel right. It works. And will just cover 99% of all cases were I have used “fopen” in the past. One of the things that I like about coding for a living is that it keeps getting better. Not me, that’s for sure, but the tools. And that almost makes up for the natural decline in raw brain power.