From ArchWiki
Revision as of 03:38, 21 November 2011 by Battocchia (talk | contribs)
Jump to: navigation, search

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, Lighttpd and Nginx. (These three pieces not necessarily shall 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 lists.[organization_name].org and
  • the lists' archives under lists.[organization_name].org/archives.
  • Lists addresses will look like [list_name]@[organization_name].org.

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

# pacman -S mailman

Mailman configuration

The configuration file is /etc/mailman/

If using Postfix

MTA = 'Postfix'


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


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

Mail server configuration


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.)

In /etc/postfix/

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 = +

Web server configuration


Getting the web stuff to work was a little tricky.

# pacman -S fcgiwrap nginx

We need to wrap mailman with fcgiwrap in order to get nginx to understand what's going on. After this installs, run this to set up your first list:

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

This will create a new mailing list, 'mailman.' This is required for mailman to start. To get mailman running, do this:

# /etc/rc.d/mailman start

You should see a message that it worked. Now that you've got mailman running, we need to get it hooked up through fcgi. Start fcgiwrap by doing this:

 # /etc/rc.d/fcgiwrap start

This will start fcgiwrap on localhost:9001. If you'd like to change the configuration, it's in /etc/conf.d/fcgiwrap.

Open up the nginx config file:

 # vim /etc/nginx/conf/nginx.conf

and add a section like this:

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

       location = / {
               rewrite ^ /mailman/listinfo permanent;

       location / {
               rewrite ^ /mailman$uri;

       location ~ ^/mailman(/[^/]*)(/.*)?$ {
               fastcgi_split_path_info (^/mailman/[^/]*)(.*)$;
               include conf/fastcgi_params;
               fastcgi_param GATEWAY_INTERFACE CGI/1.1;
               fastcgi_param SCRIPT_FILENAME $document_root$1;
               fastcgi_param PATH_INFO $fastcgi_path_info;
               fastcgi_param PATH_TRANSLATED $document_root$2;

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

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

Then start up nginx:

# /etc/rc.d/nginx start

And you should be able to visit, and it should all work!

External Links