Mailman notes

GNU Mailman is a package for handling mailing lists. For what I do it is serious overkill, and there are many things I hate about it, but it does get the job done.

The link: Mailman Made Easy promises to be a nice tutorial, we shall see. It does promise to explain how to make mailman play nice with virtual hosts, which has always been a problem. If it explains how to make it possible to use the administrative interface without having to give the admin password on two separate occasions, I will mail him a gift.

Mailman is a Python/CGI thingie. When I get better with ruby on rails I will seriously tempted to write a simple replacement to handle the small broadcast mailing lists I deal with. In the meanwhile the thing to do is to minimize my hassle dealing with mailman itself.

An established mailman setup infests the following parts of a system. /etc/aliases handles a bunch of pseudo-user mail identities by piping the incoming mail to /usr/lib/mailman/mail/mailman. The stuff necessary to make apache handle the web interface to mailman can be found in /etc/httpd/conf.d/mailman.conf. Some things (such as the sitelist.cfg file) may be found in /etc/mailman. The bulk of the system is in /usr/lib/mailman and /var/lib/mailman, with the stuff that is customized for a given site being kept in /var/lib/mailman, which is nice.

The directory /usr/lib/mailman/bin has a bunch of handy command line scripts. A simple one that is immediately useful is version. Running /usr/lib/mailman/bin/version gives me 2.1.8 on my fedora core 5 system as well as my core 4 system, and this seems to be the latest official release as of August 2006.

The bulk of mailman configuration is done by editing the mm_cfg.py file (which is in /usr/lib/mailman/Mailman, or maybe /var/lib/mailman/Mailman, or maybe /etc/mailman).

Actually on my system the active file -seems- to be the one in /usr/lib. During some upgrade, I found my file chucked into /var/lib/mailman/Mailman/mm_cfg.py.rpmsave, and a pristine file took its place in /usr/lib/mailman/Mailman/mm_cfg.py. This did take a while to sort out. /etc/mailman/mm_cfg.py is a symbolic link to the file in /usr/lib, so we will take that as where the action is at (though it really should be in /var/lib to be in the proper spirit of things). We copied the file from /var/lib back to /usr/lib and things were better.

Moving a list

Well, I have had a couple of lists running for a long time, but now need to move them to a different machine. As I pondered how to do this, it occurred to me that I might not be the first one to ever have wanted to do this. So, a google search on "moving mailman list" quickly led to a plethora of information on how to do this. It goes pretty much like this:

First move everthing in /var/lib/mailman/lists. I just used tar and did this as root, so ownerships and permissions remained as they were. In case your mileage varies, consider something like chown -R list.list lists.

Now move everthing in /var/lib/mailman/archives/private. I used tar and did this as root. Then I made links in archives/public to corresponding names (but not the mbox directories) in archive/private. I had some broken links on the old machines that trace back to an ancient mailman install on that machine, but you might find it easier to just tar up all of archives and move it links and all.

Now, for each list, do this:

/usr/lib/mailman/bin/withlist -l -r fix_url  -v

Then move over the alias stuff into /etc/aliases and run newaliases.

Amazingly, I didn't have to do ANY reconfiguration of the web server. The file that might have had to have been screwed with is /etc/httpd/conf.d/mailman.conf, but the way it is set up seems just fine. Now if I could just get rid of the doggone mailman password scheme (I have this behind an htaccess password handles by apache anyway).

I do a bit of customization in /etc/mailman/mm_cfg.py to set an override for my domain name (DEFAULT_URL_HOST and DEFAULT_EMAIL_HOST), that most people probably won't need or want to do. I have never yet had to fiddle with /etc/sitelist.cfg.

Start the mailman service:

    service mailman start
    chkconfig mailman on

Changing a list domain

I had a list on a machine under a virtual host, then changed the "real name" of that machine, and lots of links became bad (because they refered to the name of the old machine). This led me to a fairly extensive tour of the source code, and ultimately I tripped over a comment in /usr/lib/mailman/Mailman/Defaults.py that led me to do this:
cd /usr/lib/mailman
bin/withlist -l -r fix_url [listname] -v
Amazingly it worked, and this would seem to be a good thing to do every time you set up a virtual host!!
Feedback? Questions? Drop me a line!

Mailman notes / tom@mmto.org