How To Install And Configure Mailman On Ubuntu

In this tutorial I will configure a virtual host with the hostname where I will install Mailman. is also the right part of the mailing list email addresses that will be configured in Mailman, i.e., mails to a mailing list will have to be sent to the address <listname>

As your hostname will be different, please adjust this tutorial accordingly. Also make sure that your hostname exists in DNS.

Mailman can be used with many mail servers (e.g. Postfix, Exim, Sendmail, Qmail). I will use Postfix in this tutorial. Make sure you have a working Postfix installation.

Installing Mailman And Apache

As Mailman comes with a web frontend, thus need a web server in addition to Mailman. I choose Apache. Mailman and Apache can be installed as follows:

Mailman needs a so-called “site list”, which is the list from which password reminders and such are sent out from. This list needs to be created before mailman will start. To create the list, run

and follow the instructions on-screen. Note that you also need to start mailman after that, using

Mailman comes with an Apache configuration file, /etc/mailman/apache.conf, which we copy to /etc/apache2/sites-available/mailman.conf:

Open /etc/apache2/sites-available/mailman.conf

… and append the following vhost configuration to the file (there’s already a vhost for in the file which is commmented out – please don’t use that vhost as my vhost configuration differs a little bit although it looks quite similar):


The second to last line ScriptAlias / /usr/lib/cgi-bin/mailman/listinfo is optional; it makes that when you go to, you will be redirected to This makes sense if you don’t have any files to serve in the document root /var/www/lists.

Next create the document root /var/www/lists, enable the vhost configuration and restart Apache:

Because we are using a vhost here (, we need to adjust the following variables in /etc/mailman/

Configuring Postfix

Now we need to configure Postfix. First run:

Then open /etc/postfix/

… and make sure you have the following lines in it (they should be there by default):

Next we must associate the domain to the mailman: transport. How you do this depends on your Postfix configuration. Transports can be stored in a MySQL database or, like in most setups, the file /etc/postfix/transport is used for creating transports. Both cases are described below

Transports In A MySQL Database

To create the necessary transport, log into MySQL…

… and run the following MySQL commands:

Restart Postfix afterwards:

Transports In /etc/postfix/transport

If you don’t have your transport in a MySQL database, you probably use the file /etc/postfix/transport. In this case you can set up the necessary transport as follows:

Open /etc/postfix/transport

 … and add the following line:


afterwards and restart Postfix:

Creating The mailman Mailing List

Before we can start to use Mailman, we must create a mailing list called “mailman”; this is obligatory – without it Mailman won’t start:

In most cases the –urlhost and –emailhost switches are not necessary because our vhost is already named, and we also have it in /etc/mailman/ (DEFAULT_EMAIL_HOST and DEFAULT_URL_HOST), but if you want to go sure that Mailman uses the correct hostname, use these switches.

Enter the email of the person running the list: <– specify the list administrator email address Initial mailman password: <– 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:

Hit enter to notify mailman owner… <– ENTER

Now open /etc/aliases and add the aliases that you see in the output of the newlist command (this has to be done manually for each new list that you create):


Whenever you modify /etc/aliases, you need to run


Now we can finally start Mailman:

Want me to do this for you? Drop me a line: itgalaxyzzz {at} gmail [dot] com