Mailman 2

From ArchWiki

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Needs language and style improvements, this language is not really suited for articles (Discuss in Talk:Mailman 2)
Note: This page is about Mailman 2, for information about the current default, see Mailman 3.

Mailman is an application for managing electronic mailing lists. Normally you will use it along a mail server and also a web server too; for the first you may pick one between Postfix, Exim, Sendmail and Qmail —if you are unsure about which one to use, Postfix is a very good choice—; as for the latter, any web server is useful, common options are Apache HTTP Server, Lighttpd and Nginx. (These three pieces do not necessarily have to run on the same computer.)

Only the Mailman installation will be covered in this article. You can refer to the correspondent wiki pages to learn how to install the mail and web servers.

For this guide we are going to suppose that you are using a machine called "arch" and you want to setup mailing lists for the organizations "a", "b" and "c", with example domains "", "" and "" that point to "arch". For each domain,

  • Mailman's web interface will be accessible from and
  • the lists' archives under
  • Lists addresses will look like

A caveat: you can use a Mailman installation to manage lists for several domains, but two lists cannot have the same name even though its domains are different!

Mailman installation

Install the mailmanAUR[broken link: package not found] package.

Mailman configuration

The full set of configuration defaults lives in the /usr/lib/mailman/Mailman/ file. However you should never modify this file! Instead, change the file, /etc/mailman/ You only need to add values to that are different than the defaults in Future Mailman upgrades are guaranteed never to touch your file.

Web Server integration


add_virtualhost('', '')
add_virtualhost('', '')


DEFAULT_URL_PATTERN = 'http://%s/'
PUBLIC_ARCHIVE_URL = 'http://%(hostname)s/archives/%(listname)s'

For Apache make this change from the above:

DEFAULT_URL_PATTERN = 'http://%s/lists/'

MTA integration

The content of /etc/mailman/ varies depending on the chosen mail server.

Postfix integration

MTA = 'Postfix'

Once you have edited, run

# /usr/lib/mailman/bin/genaliases

to generate an aliases file that Postfix needs.

Exim integration

MTA = None

Mail Server Configuration

Note: Ensure your domain name server (DNS) setup. For mail delivery on the internet, your DNS must be correct. An MX record should point to the mail host. More info about DNS is beyond the scope of this document.


For installing and configuring this mail server, see Postfix. (If you will be using Postfix just for Mailman, its setup is much simpler: ignore all the mailbox and database stuff.)

/etc/postfix/ should have the following fields and values:

myhostname =
mydomain =
myorigin = $mydomain
mydestination = localhost,,,
mynetworks_style = host

alias_maps = hash:/etc/postfix/aliases, hash:/var/lib/mailman/data/aliases
alias_database = $alias_maps
virtual_alias_maps = hash:/etc/postfix/virtual, hash:/var/lib/mailman/data/virtual-mailman

recipient_delimiter = +


Edit your /etc/mail/exim.conf to add entries in the following sections:

In routers:

    driver = accept
    require_files = /var/lib/mailman/lists/${lc::$local_part}/config.pck
    local_part_suffix = -admin : -bounces : -bounces+* : -confirm : -confirm+* : -join : -leave : -owner : -request : -subscribe : -unsubscribe
    transport = mailman_transport

In transports:

    driver = pipe
    user = mailman
    group = mailman
    home_directory = /usr/lib/mailman
    current_directory = /usr/lib/mailman
    command = /usr/lib/mailman/mail/mailman '${if def:local_part_suffix {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}}{post}}' $local_part

Web Server Configuration


For installing and configuring this web server, see Nginx. Mailman web interface relies on CGI processing; this setup uses Nginx along fcgiwrap, see Nginx#fcgiwrap.

/etc/nginx/nginx.conf should include the following configuration per domain (example for

server {
  root /usr/lib/mailman/cgi-bin;

  location = / {
    rewrite ^ /listinfo permanent;

  location / {
    fastcgi_split_path_info ^(/[^/]*)(.*)$;
    fastcgi_pass unix:/run/fcgiwrap.sock;
    include fastcgi.conf;
    fastcgi_param PATH_INFO         $fastcgi_path_info;
    fastcgi_param PATH_TRANSLATED   $document_root$fastcgi_path_info;

  location /icons {
    alias /usr/lib/mailman/icons;

  location /archives {
    alias /var/lib/mailman/archives/public;
    autoindex on;

Note: Nginx must run with user http and group http or Mailman will complain. Be sure to define the user directive in /etc/nginx/conf/nginx.conf as follows (outside the html block):
user http http;


server.modules = ("mod_rewrite",

url.rewrite = ( "^/$" => "/listinfo" )
alias.url = (
        "/icons" => "/usr/lib/mailman/icons",
        "/archives" => "/var/lib/mailman/archives/public"

cgi.assign = (
        "/usr/lib/mailman/cgi-bin/admin" => "",
        "/usr/lib/mailman/cgi-bin/admin/" => "",
        "/usr/lib/mailman/cgi-bin/admindb" => "",
        "/usr/lib/mailman/cgi-bin/admindb/" => "",
        "/usr/lib/mailman/cgi-bin/confirm" => "",
        "/usr/lib/mailman/cgi-bin/confirm/" => "",
        "/usr/lib/mailman/cgi-bin/create" => "",
        "/usr/lib/mailman/cgi-bin/create/" => "",
        "/usr/lib/mailman/cgi-bin/edithtml" => "",
        "/usr/lib/mailman/cgi-bin/edithtml/" => "",
        "/usr/lib/mailman/cgi-bin/listinfo" => "",
        "/usr/lib/mailman/cgi-bin/listinfo/" => "",
        "/usr/lib/mailman/cgi-bin/options" => "",
        "/usr/lib/mailman/cgi-bin/options/" => "",
        "/usr/lib/mailman/cgi-bin/private" => "",
        "/usr/lib/mailman/cgi-bin/private/" => "",
        "/usr/lib/mailman/cgi-bin/rmlist" => "",
        "/usr/lib/mailman/cgi-bin/rmlist/" => "",
        "/usr/lib/mailman/cgi-bin/roster" => "",
        "/usr/lib/mailman/cgi-bin/roster/" => "",
        "/usr/lib/mailman/cgi-bin/subscribe" => "",
        "/usr/lib/mailman/cgi-bin/subscribe/" => ""

$HTTP["host"] =~ "(^|\.)$" {
        server.document-root            = "/usr/lib/mailman/cgi-bin/"
        server.errorlog                 = "/var/log/lighttpd/lists.a.org_error.log"
        accesslog.filename              = "/var/log/lighttpd/lists.a.org_access.log"


Add following line to your /etc/mailman/

IMAGE_LOGOS = '/mailman-icons/'

The example use of of creating implies creating a vhost. Consider moving the following configuration into a vhost definition instead of modifying your global httpd.conf.

Modify your /etc/httpd/conf/httpd.conf with the following snippets added.

<IfModule alias_module>
    Alias /mailman-icons/ "/usr/lib/mailman/icons/"
    Alias /archives/ "/var/lib/mailman/archives/public/"
    ScriptAlias /lists/ "/usr/lib/mailman/cgi-bin/"
    ScriptAlias / "/usr/lib/mailman/cgi-bin/listinfo"

<Directory "/usr/lib/mailman/cgi-bin/">
    AllowOverride None
    Options Indexes FollowSymlinks ExecCGI
    Require all granted

<Directory "/usr/lib/mailman/icons/">
    Require all granted

<Directory "/var/lib/mailman/archives/public/">
    Require all granted

Restart httpd.service.

Post configuration

Site-wide mailing list

To create this specific list requested by Mailman for its proper operation (between other things, it is used for password reminders), run:

# /usr/lib/mailman/bin/newlist mailman

This will create a list called "mailman" under the default domain ( in the example). You do not have to do it for the other domains (i.e. and

Later you should also subscribe yourself to the site list.

Set up timers

Several Mailman features occur on a regular schedule, so you must set up timers to run the right programs at the right time.

# cd /usr/lib/systemd/system
# for X in mailman-*.timer ; do systemctl enable $X && systemctl start $X ; done

Start Mailman

Mailman will not start processing and sending emails until the mailman daemon is started, and optionally enabled, with systemctl.

If you run into problems, run it more verbose so it can help you troubleshoot:

# /usr/lib/mailman/bin/mailmanctl start

Create a password

There are two type of passwords that you can create from the command line. The first is the "general password" which can be used anywhere a password is required in the system. The site password will get you into the administration page for any list, and it can be used to log in as any user.

The second password is a site-wide "list creator" password. You can use this to delegate the ability to create new mailing lists without providing all the privileges of the site password. Of course, the owner of the site password can also create new mailing lists, but the list creator password is limited to just that special role.

To set the general password, use this command:

# /usr/lib/mailman/bin/mmsitepass <general-password>

To set the list creator password, this:

# /usr/lib/mailman/bin/mmsitepass -c <list-creator-password>

It is okay not to set a list creator password, but you probably do want a general password.

Using Mailman

To administrate your lists (create and configure lists, manage users, etcetera) use the web interface; remember that each domain has its own. For example, the URL of organization "a" would be

Mailman can be also managed by command-line. Example for list creation:

# newlist list_name


You should check that your installation has all the correct permissions and group ownerships by running the check_perms script:

# /usr/lib/mailman/bin/check_perms

. If it reports problems, then you can either fix them manually or use the same program to fix them (probably the easiest solution):

# /usr/lib/mailman/bin/check_perms -f

. Repeat previous steps until no more errors are reported!


Make sure that the files in /var/lib/mailman/data/:

  • aliases.db,
  • aliases,
  • virtual-mailman,
  • virtual-mailman.db,

are user and group owned by mailman and that are group writable.


See also