Migrating Mailman Lists to Snow Leopard Server (10.6)

8 07 2010

Recently I was asked as part of my network/server admin duties to migrate a few mailing lists which had previously resided on a Debian system over to our OS X (10.6.4) system.

As it turned out this was a relatively trivial task but not without it’s hurdles.

The knowledge base for the Mailman system is quite extensive but due to the way Apple have messed with the setup of a lot of specific stuff like Mailman it turned out to be quite time consuming in the research, and a bit of trial and error to get it working correctly..

Just for clarification here are the differences between the folder structures.

Linux/Unix based systems generally keep all the Mailing list specifics, including bin and script files, archive and logs in subfolders of:
/var/lib/mailman

Whereas OS X really like to mix things up.
The archives, lists, logs, spam, data, locks and qfiles are all subfolders of:
/private/var/mailman/

The remaining folders including cgi-bin, messages, Mailman, cron, icons, scripts, bin, mail and templates are all subfolders of:
/usr/share/mailman/

Ok differences noted….

It should also be noted that the entire lists archive from the linux machine was transferred to the server and left in a temporary location as a .tar.bz2 file.

Open Server Admin and turn off the mail service.
Open the terminal and cd to where the Mailman archive was put
sudo su

Extract the archive
bzcat archive.tar.bz2 | tar xvf -

Enter the lists folder
cd var/lib/mailman/lists

Copy the required lists
rsync -a ./list-name /private/var/mailman/lists/
cd ../archives

Copy the required archives
rsync -a ./listName* /private/var/mailman/archives/private/

Fix the lists permissions and owner
cd /private/var/mailman/archives/private/
chmod -R 775 listname
chown -R nobody:_mailman listname
cd ../../lists
chmod -R 775 listname
chown -R nobody:_mailman listname

Create the public symlinks (if required)
cd ../archives/public
ln -s ../private/listname .

Fix the domain URL in the archives
cd /usr/share/mailman/bin/
./withlist -l -a -r fix_url — -v

Open Server Admin again and turn back on the mail service and you should see your new mailing lists listed in the appropriate tab under settings.

Note: If you have separate Virtual Domains you will need to change the withlist to:
./withlist -l -r fix_url listname -u url_host
and do each list in each different domain individually.

You can then test your Lists and your archives to make sure they work correctly.

Update 9/10
Further testing of the archives revealed that the ‘More Information’ links in the archive period and each thread page still pointed to the old server.

In the folder for each list there is an index.html which lists all the archive periods and a number of subfolders each named after the archive period they represent. These folders contain the html files that you see when you drill down through the archive.
These and the index.html contain hardcoded links to the server which contains the archive.

Easy to fix.
First make yourself su as regular users cannot access the lists folders
sudo su
cd to the private archives
sudo cd /private/var/mailman/archives/private/ListName
Replace the server name in the index.html
perl -pi -e ‘s/old.server/new.server/gi’ ./index.html
Replace the server name in all the sub folders html files
perl -pi -e ‘s/old.server/new.server/gi’ ./*/*.html

Alternatively if you moved a lot of lists and they are all on the same server domain you could do the replace from the private folder and replace all occurrences in all lists.
perl -pi -e ‘s/old.server/new.server/gi’ ./*/index.html
perl -pi -e ‘s/old.server/new.server/gi’ ./*/*/*.html

This worked for me and may require slight modification for your mailman archives.

Advertisement

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.