Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

How To Install And Configure Mailman (With Postfix) On Debian Squeeze

Mailman is an open-source mailing list manager, i.e., it can be used to manage email discussions and newsletter lists. It is probably the most popular and widely used mailing list manager on the Internet. This tutorial explains how to install and configure Mailman on a Debian Squeeze server with a Postfix mail server.

I do not issue any guarantee that this will work for you!


1 Preliminary Note

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, for example as shown in this tutorial: Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Debian Squeeze)


2 Installing Mailman And Apache

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

apt-get install mailman apache2

You will see the following questions/messages:

Languages to support: <– en (English)
Missing site list
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 “newlist mailman” and follow the instructions on-screen. Note that you also need to start mailman after that, using /etc/init.d/mailman start.
<– Ok

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

cp /etc/mailman/apache.conf /etc/apache2/sites-available/mailman.conf

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

vi /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):

<VirtualHost *:80>
DocumentRoot /var/www/lists
ErrorLog /var/log/apache2/lists-error.log
CustomLog /var/log/apache2/lists-access.log combined

<Directory /var/lib/mailman/archives/>
    Options FollowSymLinks
    AllowOverride None

Alias /pipermail/ /var/lib/mailman/archives/public/
Alias /images/mailman/ /usr/share/images/mailman/
ScriptAlias /admin /usr/lib/cgi-bin/mailman/admin
ScriptAlias /admindb /usr/lib/cgi-bin/mailman/admindb
ScriptAlias /confirm /usr/lib/cgi-bin/mailman/confirm
ScriptAlias /create /usr/lib/cgi-bin/mailman/create
ScriptAlias /edithtml /usr/lib/cgi-bin/mailman/edithtml
ScriptAlias /listinfo /usr/lib/cgi-bin/mailman/listinfo
ScriptAlias /options /usr/lib/cgi-bin/mailman/options
ScriptAlias /private /usr/lib/cgi-bin/mailman/private
ScriptAlias /rmlist /usr/lib/cgi-bin/mailman/rmlist
ScriptAlias /roster /usr/lib/cgi-bin/mailman/roster
ScriptAlias /subscribe /usr/lib/cgi-bin/mailman/subscribe
ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
ScriptAlias / /usr/lib/cgi-bin/mailman/listinfo

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:

mkdir /var/www/lists
a2ensite mailman.conf
/etc/init.d/apache2 restart

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

vi /etc/mailman/

DEFAULT_URL_PATTERN = 'http://%s/'


3 Configuring Postfix

Now we need to configure Postfix. First run:

postconf -e ‘relay_domains =’
postconf -e ‘mailman_destination_recipient_limit = 1’

Then open /etc/postfix/

vi /etc/postfix/

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

mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/
  ${nexthop} ${user}

Next we must associate the domain to the mailman: transport. How you do this depends on your Postfix configuration. For example, if you have set up your server according to the Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Debian Squeeze) tutorial, transports are stored in a MySQL database; in most other setups, the file /etc/postfix/transport is used for creating transports. I am going to describe both cases in chapters 3.1 and 3.2.


3.1 Transports In A MySQL Database

If you have set up your server according to the Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Debian Squeeze) tutorial, transports are stored in the transport table in the mail MySQL database. To create the necessary transport, log into MySQL…

mysql -u root -p

… and run the following MySQL commands:

USE mail;
INSERT INTO `transport` (`domain`, `transport`) VALUES (‘’, ‘mailman:’);

Restart Postfix afterwards:

/etc/init.d/postfix restart


3.2 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:

postconf -e ‘transport_maps = hash:/etc/postfix/transport’

Open /etc/postfix/transport

vi /etc/postfix/transport

… and add the following line:      mailman:


postmap -v /etc/postfix/transport

afterwards and restart Postfix:

/etc/init.d/postfix restart


4 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:

newlist – – mailman

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.

root@server1:~# newlist – – mailman
Enter the email of the person running the list:
 <– specify the list administrator email address, e.g.
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:

## 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… <– 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):

vi /etc/aliases

## 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"

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

/etc/init.d/postfix restart


Now we can finally start Mailman:

/etc/init.d/mailman start

root@server1:~# /etc/init.d/mailman start
Starting Mailman master qrunner: mailmanctl.

5 Using Mailman

From now on, we can use the Mailman web interface to manage Mailman (with one exception – whenever you create a new mailing list, you have to add new aliases to /etc/aliases manually on the command line).

The admin interface can be reached on – on that page you should find a link to the Mailman mailing list you created in chapter 4:


If you click on that link ( you will get to the management page of the Mailman list, but first you have to log in with your password (that’s the one you specified during the newlist command):


That’s how the management page looks – from here you can…


… change the basic settings of the list…


… or moderate new messages (


Users can go to to get a list of all available mailing lists…


… or to to go to a specific list (mailman in this example) where they can subscribe:


You as the admin can also create new lists using the web interface (on, but before you do this, run

mmsitepass mailman_password

on the command line because otherwise you will the error message Error: You are not authorized to create new mailing lists when you try to create a mailing list through the web interface (I suggest you use the same password – mailman_password – as in the newsite command in chapter 4).

To create a new list through the web interface, specify the name of the list and the owner’s email address, specify a list password (or have the web interface generate one for you)…


… and at the bottom of the page, specify the password that you used with the mmsitepass command; then click on Create List:


In case of success, you should see the following page:


The list owner will also receive an email with instructions about how to modify /etc/aliases to make the list creation complete:

The mailing list `testlist1′ has been created via the through-the-web
interface.  In order to complete the activation of this mailing list, the
proper /etc/aliases (or equivalent) file must be updated.  The program
`newaliases’ may also have to be run.

Here are the entries for the /etc/aliases file:

testlist1:              “|/var/lib/mailman/mail/mailman post testlist1”
testlist1-admin:        “|/var/lib/mailman/mail/mailman admin testlist1”
testlist1-bounces:      “|/var/lib/mailman/mail/mailman bounces testlist1”
testlist1-confirm:      “|/var/lib/mailman/mail/mailman confirm testlist1”
testlist1-join:         “|/var/lib/mailman/mail/mailman join testlist1”
testlist1-leave:        “|/var/lib/mailman/mail/mailman leave testlist1”
testlist1-owner:        “|/var/lib/mailman/mail/mailman owner testlist1”
testlist1-request:      “|/var/lib/mailman/mail/mailman request testlist1”
testlist1-subscribe:    “|/var/lib/mailman/mail/mailman subscribe testlist1”
testlist1-unsubscribe:  “|/var/lib/mailman/mail/mailman unsubscribe testlist1”

Therefore open /etc/aliases

vi /etc/aliases

… add the new aliases…

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

… and run:

/etc/init.d/postfix restart

Instead of using the Mailman web interface, you can also use the newlist command to create a new list, as shown in chapter 4:

newlist – – testlist2

root@server1:~# newlist – – testlist2
Enter the email of the person running the list:
Initial testlist2 password: <– testlist2_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:

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

Hit enter to notify testlist2 owner… <– ENTER


vi /etc/aliases

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

/etc/init.d/postfix restart

The email address of a new list is always <listname>, e.g. or


  • Mailman:
  • Debian: