I’m doing a few things today, the first of which is fixing up my mailstore.

I’ve been collecting my mail for the better part of seven years now. I can rewind into my mail spool for nearly three quarters of a decade, and can fairly trivially locate messages in that set.

I started using IMAP for mail access a few years ago, with the Dovecot IMAP server (which I chose because it’s the most straightforward to configure and the most powerful from a legible config file). The IMAP protocol requires all sorts of nice search functions to be implemented by a mail server, and Dovecot implements these; failing that, I could use mairix.

Except, of course, that mairix can’t handle some of my mail folders. Hell, even Mutt can’t handle some of them; they’re simply too large.

Also, the various mail clients I’ve been using on and off for years — mostly Mutt, but also, variously, Thunderbird, Gnus, Apple Mail, Evolution, Android Mail, and, once upon a long time ago, Outlook — have left my mail directories in a mess. And then there was one of my broken mail injection scripts which didn’t bother locking anything as it injected mail into spools, causing dozens of broken messages (which Mairix slowly is digging up).

A few months ago, one of the first non-trivial Ruby hacks I wrote, apsc, was solely designed to sort mail. The Advanced Postal Sorting Centre showed off the awesome features of Ruby that I was coming to terms with.

One of the main things that dominates my mail collection is thousands and thousands of archived messages from various mailing lists, followed by hundreds of personal and work-related messages, and getting around the collection is difficult.

So, currently I’m

  • migrating my entire mail hierarchy to two Maildirs,
  • quarantining broken messages,
  • sorting mail out by month into mboxes.

There’s some logic in what I’m doing here: I’m using two Maildirs: one for critical, personal and/or work-related mail, and the other for mailing list archives. Messages broken by my old spool injector need to be quarantined, and if they’re recoverable, recovered. Finally, stitching mailboxes back together (or perhaps I’ll leave them as maildirs and switch the IMAP server to use Maildirs and mailboxes?).