This site is now 100% read-only, and retired.

Mailman and Exim4

Posted by Takaitra on Thu 18 Sep 2008 at 06:57

I recently installed Mailman on on my server to provide a mailing list for my extended family. While in the end, I was able to scrounge up the articles I needed by searching the web, many of them were woefully outdated. Here is a short article that pulls together my research and describes in one place what is needed to get Mailman running happily under Debian etch with Exim4.


This guide assumes that you are running a recent release of Debian and have Exim4 installed and working.

Installing and Configuring Mailman

To install mailman, simply run the following command:

apt-get install mailman

During the install, you will be prompted to choose which languages you want mailman to support.

After the install is complete, follow the instructions given during the install and setup the Mailman-specific mailing list.

newlist mailman

There are just a few changes that must be made to the basic configuration. Open /etc/mailman/ and edit the following items:

# Default domain for email addresses of newly created mailing lists

# Default host for the web interface of newly created mailing lists

# Uncomment this. In this setup, the alias file won't need to be changed.
MTA=None   # Misnomer, suppresses alias output on newlist

The last line makes no functional changes to mailman but will stop commands like "newlist" from outputing messages we won't need. Restart mailman so that the configuration changes take effect:

/etc/init.d/mailman restart

Now would be a good time to set up any other mailing lists you will need using the same "newlist" command. If your list will be using anything other than the DEFAULT_URL_HOST we set up earlier as its web interface hostname, make sure to pass that to newlist with the -u flag.

Exim Configuration

The classic way of integrating Mailman with your MTA is to add each mailing list address to /etc/alias as a pipe to the mailman process. This is no longer the recommended way to configure Mailman with Exim. In fact, when I did try to add a piped alias, Exim choked on it because its default configuration no longer allows these for security reasons. So instead of adding dozens of lines to our alias file, we will be following the how-to to allow all Mailman addresses to automatically be handled by Exim.

Assuming you are using the split config, you will need to create the files listed below. If you are using a single file for configuration, you will need to find the appropriate places to insert the items.

# Mailman macro definitions

# Home dir for the Mailman installation

# User and group for Mailman

# Domains that your lists are in - colon separated list
# you may wish to add these into local_domains as well

# The path of the Mailman mail wrapper script
# The path of the list config file (used as a required file when
# verifying list addresses)

  driver = accept
  domains = +mm_domains
  require_files = MM_LISTCHK
  local_part_suffix = -admin : \
    -bounces   : -bounces+*  : \
    -confirm   : -confirm+*  : \
    -join      : -leave      : \
    -owner     : -request    : \
    -subscribe : -unsubscribe
  transport = mailman_transport

  driver = pipe
  command = MM_WRAP \
    '${if def:local_part_suffix \
    {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
    {post}}' \
  current_directory = MM_HOME
  home_directory = MM_HOME
  user = MM_UID
  group = MM_GID

After you finish creating the various configuration files, run the following commands to build the updated configuration file and restart exim:
/etc/init.d/exim4 restart

Apache Configuration

mailman uses CGI to create a web interface for its mailing lists. We need to configure Apache in order to get this piece working. First create a file to store some new aliases for the web server.

Alias /pipermail /var/lib/mailman/archives/public
Alias /images/mailman /usr/share/images/mailman
<directory /var/lib/mailman/archives/public>
    DirectoryIndex index.html

Then create (or edit) a VirtualHost entry to allow the scripts to run.

<virtualhost *:80>
        DocumentRoot /var/www/
        <directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                RedirectMatch ^/$ /cgi-bin/mailman/listinfo

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all

If this is a new file, remember to symlink it to the sites-enabled directory.

Finally, restart Apache so that the changes take effect.
/etc/init.d/apache2 restart

Administer your List

That completes the setup! You can begin administering your new list at



Re: Mailman and Exim4
Posted by Anonymous (88.179.xx.xx) on Mon 28 Feb 2011 at 00:24
To view properly images in the web interface, I had to add, into your virtualhost setting in apache the following line :

Alias /images/ "/usr/share/images/"

[ Parent ]