Configuring [[http://www.gnu.org/software/mailman/|Mailman]] for Ubuntu

Taken from http://freemars.org/howto/mailman.html

Draft - Started 17 December 2005 Released to the unsuspecting world - 21 December 2005 Latest minor revision - 24 August 2006 at 01:30 PM

Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. Software selected

Install

There is only one package you'll need to add - mailman. Use Synaptic Package Manager or apt-get to add it to your machine.

It's my belief the Ubuntu install files leave you with the wrong file ownerships, so if you haven't already opened a terminal window do so and become root $ sudo -s (and enter your password) Mailman includes a handy script to make check your permissions. It's in /usr/sbin/ so it should be on root's path. # check-perms - and note the massive problems. To fix permissions, # check-perms -f A bunch of changes scroll by, but did it get them all? # check-perms -f Nope; still errors. In fact, you need to # cd /var/lib/mailman # chown -R list:list *

Of course I'm using example.com for this HOWTO. Substitute your own domain name. Mailman configuration files

The Mailman configuration files are in /etc/mailman. Use your favorite text editor to edit /etc/mailman/mm_cfg.py. You'll want to check/edit/add the following lines:

 MTA=None # No MTA processing req'd for Ubuntu/virtual/postfix-to-mailman.py
 
 IMAGE_LOGOS = '/icons/'
 
 DEFAULT_EMAIL_HOST = 'example.com'
 DEFAULT_URL_HOST = 'example.com'
 

I'm not sure if you need this line - can someone tell me?

 DEB_LISTMASTER = 'postmaster@example.com'

Apache 2 config files are in /etc/apache2. The Apache authors think you should put anything that looks like a module in mods-available and mods-enabled. Go ahead and create a new file: /etc/apache2/mods-available/mailman.conf

 ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
 ScriptAlias /cgi-bin/mailman/ /usr/lib/cgi-bin/mailman/
 
 <Directory /usr/lib/cgi-bin/mailman/>
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
 </Directory>
 Alias /pipermail/ /var/lib/mailman/archives/public/
 <Directory /var/lib/mailman/archives/public>
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
 </Directory>

Optional - pipermail is one of those directory names which hangs around for historical reasons but makes little sense to users. You might want to add a more sensible-sounding alias for the mailing list archives.

 Alias /archives/ /var/lib/mailman/archives/public/
 <Directory /var/lib/mailman/archives/public>
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
 </Directory>

Now add a symlink to this file so Apache will use your new Mailman aliases the next time it starts:

 # cd /etc/apache2/mods-enabled
 # ln -s /etc/apache2/mods-available/mailman.conf mailman.conf

All your configuration files are now set. Activate everything by restarting your services:

 # /etc/init.d/apache2 restart
 # /etc/init.d/postfix reload
 # /etc/init.d/mailman start

Create your first list

Mailman doesn't have anything to do until there is at least one list for it to act on, so let's make one:

 # newlist mailman

You'll be asked for an administrator email address - give it yours - and a password. If all goes well you should immediately get an email welcoming you to your new list. The email will have a URL where you can go and experiment with the web-based mailman configuration. There's just one thing that won't work – emails sent to the list will not work. On to the final section of this howto. Adding MySQL aliases

If you've installed phpmyadmin as Ivar suggests you can use a GUI interface, otherwise you'll edit your MySQL database through the command line. Insert the following entries into the aliases table of the maildb database:

 mail	destination
 mailman@example.com	                mailman@lists.example.com
 mailman-admin@example.com	        mailman-admin@lists.example.com
 mailman-bounces@example.com	        mailman-bounces@lists.example.com
 mailman-confirm@example.com	        mailman-confirm@lists.example.com
 mailman-join@example.com	        mailman-join@lists.example.com
 mailman-leave@example.com	        mailman-leave@lists.example.com
 mailman-owner@example.com	        mailman-owner@lists.example.com
 mailman-request@example.com	        mailman-request@lists.example.com
 mailman-subscribe@example.com        mailman-subscribe@lists.example.com
 mailman-unsubscribe@example.com	mailman-unsubscribe@lists.example.com

Your 'mailman' list should be operational.