Mail::Box++

BooK on 2009-10-14T07:00:40

So sferics' disk died and took everything that wasn't backed up with it. It turns out that one of the important configuration items that weren't backed up were the configurations and subcribers lists of the Mailman mailing-lists.

To get the subscribers lists back, we didn't have many options:

  • Resubscribe all posters, which would also subscribe the ones who did unsubscribe at some point, and kick out all the lurkers... Not so good.
  • Process all the administrative messages to get a chronological list of subscribe/unsubscribe action, and rebuild the list from there.
  • Seed the list with the list of posters, if possible the subscribed ones (i.e. not the one whose mails were passed through moderation)

We use Mailman for managing our mailing-lists. It works well enough for us, but it has its share of hate:

  • Localized admin messages are nice, but a X-Mailman-Action header would be nicer, so we would have to process the body of each actions, in all languages we might have used

Luckily, it also has a few helpful headers:

  • List-Id, so we can process a folder full of admin messages and know about which list each message is about
  • X-Mailman-Approved-At, so we can detect messages sent by non-subscribed posters

I used Mail::Box to create two scripts to process the messages (in French and English, so anyone who subscribed in German is out of luck) and provide some useful info (the people with the archives and the admin-fu did the actual work of fixing the lists).

Sure, Mail::Box is slow, and the interface is a bit complicated, but on the other hand it is well documented, and it's correct.

Summary at the end of the day^Wlong week-end:

  • (incomplete backups)--
  • Mailman-- # misses useful headers that would have made the job easier
  • Mail::Box++ # gets the job done in 20 lines