[Mailman-Users] Few questions for the Mailman list...

Greg Ward gward at mems-exchange.org
Mon Oct 1 20:55:13 CEST 2001


On 01 October 2001, Jon Carnes said:
> > I was particulalry interested in:
> > 1. How your software stores and accesses the mailing list information
> > (List Members, Administrators, Moderators, Members).
> 
> The information for each list is stored in a large database file called
> "config.db" which is stored in a directory ~mailman/lists/email-list-name.
> The database stores the configuration of the list as well as the members and
> the configuration of each member in that file in text format.
> Mailman also maintains a backup copy of config.db in the file
> "config.db.last".  This is a copy of "config.db" before the last time it was
> changed.

Jon forgot one little detail, which is the format of config.db.  It's a
Python "marshall" file, ie. written by the "marshall" module from
Python's standard library.  Mailman comes with a bunch of command-line
utilities for viewing/manipulating lists, but if you need to step
"outside the box", you'll have to write a bit of Python code.

Eg. if you run this from ~mailman:

  $ python
  Python 2.1 (#2, May  8 2001, 10:50:59) 
  [GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2
  Type "copyright", "credits" or "license" for more information.
  >>> from marshal import load
  >>> config = load(open("lists/foo/config.db"))

the config.db for the "foo" list is loaded into a Python dictionary
'config', which you can then grub about in as much as you please.  This
is probably not necessary very often, but it's nice to know that it can
be done.

BTW, this holds for Mailman 2.0 and earlier.  I believe Mailman 2.1 uses
"pickle" (another, more powerful persistence mechanism for Python) for
list config information.

> > 6. I'd also like to know what way the lists are stored...
> > Are they in a flat file/DB/Hash? How's this achieved for your product?
> 
> The lists are stored in a db format as part of the config.db file.  The data
> is stored as text, and can be accessed and manipulated by any standard .db
> access program.

Were you talking about the list meta-data (name of list, subscribers,
subscriber options, etc.) or the message archive itself?  The archive is
stored as one big traditional Unix "mbox" file, ie. with messages
separated by "\n\nFrom ".  I believe the web interface to the archive is
generated by reading that mbox file and spewing a bunch of HTML files.

        Greg
-- 
Greg Ward - software developer                gward at mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org




More information about the Mailman-Users mailing list