Virtual Mailman


This page tells how I installed side by side mailmans with postfix and apache2 on a Debian Etch system (well only one is installed as I write this but more will be soon). It is put here so that I remember how to add more mailmans and in hopes it might help someone else with a similar setup. There are two parts. Part one tells how to download and get mailman ready to be install. Part two installs one mailman system. You can repeat part two for every domain name you want to install mailman on.

Part One

Get the mailman files and ready them for use.
  1. Make the mailman directory, also make a directory called install where we will be putting all the install files for mailman.
    mkdir /usr/local/mailman
    mkdir /usr/local/mailman/install
  2. Get the mailman source package, unpack it and go into the directory.
    cd /usr/local/mailman/install
    tar -xf mailman-2.1.11.tgz
    cd mailman-2.1.11
  3. Edit Mailman/MTA/ in your favorite editor.
    Change line 112 from
    print >> fp, k + ':', ((fieldsz - len(k)) * ' ') + v
    print >> fp, k + '_'+mlist.host_name+':', ((fieldsz - len(k)) * ' ') + v
    Now go to line 150 and change it from
    print >> fp, fqdnaddr, ((fieldsz - len(k)) * ' '), k
    print >> fp, fqdnaddr, ((fieldsz - len(k)) * ' '), k+'_'+hostname+'@localhost'
    Why? Because the maps turn out wrong without it. The virtual-mailman would look like mailman
    This does not even seem to work as it needs to be mailman@localhost
    I am not sure how it works for anyone without the localhost. But even more for my setup it needs to look like
    Without the extra, mail from and would collide. The first edit makes the aliases map match with rather then mailman.

Part Two

Now to install our first mailman, we start off where we left off inside /usr/local/mailman/install/mailman-2.1.11. I am going to call this mailman installation skagitattic.
  1. Make a dir to hold our new mailman install, own mailman:mailman, and set the correct permissions.
    mkdir /usr/local/mailman/skagitattic
    chown mailman:mailman /usr/local/mailman/skagitattic
    chmod 02775 /usr/local/mailman/skagitattic
  2. Next we run configure and make install. Be sure to set prefix urlhost and mailhost right. I also ran into some things I needed to install like the python dev package.
    ./configure --prefix=/usr/local/mailman/skagitattic
    make install
    cd /usr/local/mailman/skagitattic
  3. Do some permission setting to make sure no one else on the system can view private data, but www-data can. I guess pretty much anyone who can run cgi scripts on the system can get to private archives. That needs fixing sometime.
    chmod 770 archives/private
    chown www-data archives/private
    chmod o-x archives/private
  4. Configure the web server add
    ScriptAlias /mailman/ /usr/local/mailman/skagitattic/cgi-bin/
    Alias /pipermail/ /usr/local/mailman/skagitattic/archives/public/
    <Directory /usr/local/mailman/skagitattic/archives/public/>
      Options FollowSymLinks
    to apache`s config for the site.
  5. Edit Mailman/ in your favorite editor. Add
    MTA = 'Postfix'
    to the end of the file(replacing with your domain).
  6. Configure postfix to read the aliases for the new list. Open up and add
    virtual_alias_maps = Whatever_Maps_you_are_already_using,hash:/usr/local/mailman/skagitattic/data/virtual-mailman
    alias_maps = Whatever_Maps_you_are_already_using,hash:/usr/local/mailman/skagitattic/data/aliases
  7. Set up mailman mailing list.
    bin/newlist mailman
    bin/config_list -i data/sitelist.cfg mailman
  8. Set up cron.
    cd cron
    crontab -u mailman
    cd ..
  9. Set up a site wide password and if you feel like it a list creator one.
    bin/mmsitepass -c
  10. Fix any permission problems.
    ./bin/check_perms -f
  11. Start mailman
    bin/mailmanctl start
  12. Set mailman to start up on computer reboot.
    cp scripts/mailman /etc/init.d/mailman-skagitattic
    update-rc.d mailman-skagitattic defaults
  13. Enjoy!
I needed "DEFAULT_URL_HOST = ''" when setting up one of the mailman sites.

Send me, comments or questions. Much of this comes from the mailman install manual at Also a big thanks to my brother for helping me with my little python edit, the fine people at the mailman mailing list and irc chanel, and the postfix people over on freenode for helping me get this setup working.

Keelan Long