Home > Support > HOWTO List > Mailing lists with Mailman

Mailing list options

There is several well known mailling list programs available. Those include Mailman, Majordomo, and Sympa. Mailman is generally regarded as the most mature and feature rich option, and integrates well with most mail servers, including Postfix (RimuHosting recommended).

Installing Mailman in Debian

Its easy to install the basic package, but there can be a few manual steps to get up and running, since the default debian install does not include some basic tweaks. Additionally a lot of documentation is a bit old now which we hope to address here. (Comands below are meant to be run in the server command shell, usually over ssh)

Download and install the package and any missing dependencies automatically...

apt-get install mailman

Follow the directions on screen to set the language. Complete the installation by creating the 'mailman' default mailing list and setting up the aliases for that, then finally start the Mailman service.

test:~# newlist mailman
Enter the email of the person running the list: yourname@example.com
Initial mailman password: 
To finish creating your mailing list, you must edit your /etc/aliases (or
equivalent) file by adding the following lines, and possibly running the
`newaliases' program:

## mailman mailing list
mailman:              "|/var/lib/mailman/mail/mailman post mailman"
mailman-admin:        "|/var/lib/mailman/mail/mailman admin mailman"
mailman-bounces:      "|/var/lib/mailman/mail/mailman bounces mailman"
mailman-confirm:      "|/var/lib/mailman/mail/mailman confirm mailman"
mailman-join:         "|/var/lib/mailman/mail/mailman join mailman"
mailman-leave:        "|/var/lib/mailman/mail/mailman leave mailman"
mailman-owner:        "|/var/lib/mailman/mail/mailman owner mailman"
mailman-request:      "|/var/lib/mailman/mail/mailman request mailman"
mailman-subscribe:    "|/var/lib/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe:  "|/var/lib/mailman/mail/mailman unsubscribe mailman"

Hit enter to notify mailman owner...

test:~# vim /etc/aliases
test:~# newaliases
test:~# /etc/init.d/postfix restart
Stopping Postfix Mail Transport Agent: postfix.
Starting Postfix Mail Transport Agent: postfix.
test:~# /etc/init.d/mailman start
Starting Mailman master qrunner: mailmanctl.

Note that for improved security Mailman is run under the 'list' system user.

ref Running a mailing list with Mailman

Set up scheduled tasks (archives, reminders, etc)

Mailman uses the system cron service to keep various components in sync. To set that up do crontab -u list /var/lib/mailman/cron/crontab.in.

To test if that looks right use crontab -u list -l. If you need to make changes edit the file in /var/lib/mailman/cron/crontab.in and rerun the command in the previous paragraph. Depending on your needs you will likely want to disable the 'gateway' job.

ref How to fix GNU MailMan 'gate_news' Cron Error

Enable Mailman web interface with Apache

To add the default configuration provided by mailman to apache do

cp /etc/mailman/apache.conf /etc/apache2/conf.d/mailman.conf
/etc/init.d/apache2 restart

Then under a standard apache install you will see mailman at http://<yourip>/cgi-bin/mailman/listinfo/mailman. There are a number of tweaks and tips in the above copied file which I recommend reading to make things integrate a bit more cleanly with your services.

Webmin modules for Mailman

As you may have seen mailman has a built in interface for web interaction. Webmin has a (currently experimental) module in development for administrative tasks which you can see at Sourceforge

Mailman in Plesk

Or Plesk install typically has Mailman installed an enabled by default. Much of the discussion above talks about manually managing the service, if you are using Plesk we recommend managing Mailman from the control panel instead to avoid conflicts with the control panel.

Some common Mailman issues

Mailman list messages not going through?  Check that the Mailman service is running /etc/init.d/mailman restart. And if not start it and make it run on boot up (on Centos or Fedora run chkconfig --level 3 mailman on, under Debian or Ubuntu run update-rc.d mailman defaults).

You can see the mail queues at something like /var/mailman/qfiles or /var/lib/mailman/qfiles. If the queue is still not being cleared out then delete old lockfiles.  e.g. locks/master-qrunner.domain.pid