View Mailman config files

If you need to go back through Mailman backups to look at a mailing list’s configuration or membership over time, you’ll find the configuration in a bunch of config.pck files. Reading them is simple enough.

The config.pck file in each mailing list’s directory1 is a Python pickle, so you need to “import pickle”. You also need to import Mailman; the easiest way to do that is to link your Mailman install’s paths.py file into your working directory.

  • ln -s /usr/share/mailman/bin/paths.py
  • python
  • import paths
  • import Mailman, pickle
  • configFile = open('config.pck')
  • config = pickle.load(configFile)
  • config['created_at']
  • members = config['members'].keys()
  • members.sort()
  • "\n".join(members)

If you have some really old backups lying around, you might have some config.db files instead of config.pck. These are marshal files. They work the same way, but you need to import “marshal” instead of “pickle”.

  • ln -s /usr/share/mailman/bin/paths.py
  • python
  • import paths
  • import Mailman, marshal
  • configFile = open('config.db')
  • members = marshal.load(configFile)
  • members['passwords']

Mailman switched from storing config files using marshal to using pickle at version 2.1, which was released December 31, 2002.

  1. Which will be something like mailman/lists/<list-name>/config.pck.