Page Discussion History


Revision as of 15:26, 29 November 2011 by MichaelLustfield (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)



Mailman is free software for managing electronic mail discussion and e-newsletter lists. Mailman is integrated with the web, making it easy for users to manage their accounts and for list owners to administer their lists. Mailman supports built-in archiving, automatic bounce processing, content filtering, digest delivery, spam filters, and more.

Apache has caused some extremely configurations to exist. Nginx tends to focus on simplicity. In the example below, I installed and configured mailman through the Ubuntu repositories.


To install mailman from the Ubuntu repository:

aptitude install mailman

From here, it's best to just follow the Mailman website. Configuration of mailman itself is a massive topic beyond the scope of this page.

Nginx Config

If the above is how you installed then the below will be nearly a drop in working model.

Nginx Config:

server {
        server_name lists.DOMAIN.TLD;
        root /usr/lib/cgi-bin;
        location = / {
                rewrite ^ /mailman/listinfo permanent;
        location / {
                rewrite ^ /mailman$uri;
        # Some installations like to force cgi-bin/ in the url.
        location ~ ^/cgi-bin/mailman(/[^/]*)(/.*)?$ {
                proxy_set_header Host $host;
        location ~ ^/mailman(/[^/]*)(/.*)?$ {
                proxy_set_header Host $host;
        location /images/mailman {
                alias /var/lib/mailman/icons;
        location /pipermail {
                alias /var/lib/mailman/archives/public;
                autoindex on;


In order for this to work you will need to have CGI processing available. There are a few guides to this but I "hopefully" took the pain out of it.

You will want to use either thttpd (recommended) or fcgiwrap.

To use thttpd-



If using fcgiwrap, you will want your mailman location block to look like this:

        location ~ ^/mailman(/[^/]*)(/.*)?$ {
                fastcgi_split_path_info (^/mailman/[^/]*)(.*)$;
                include 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;
                fastcgi_pass unix:/tmp/cgi.sock;

Look at the fcgiwrap page for help setting up that tool.


The seemingly simple setup above actually took a lot of work because of the files being spread across the operating system. For that reason, we need to add a little bit of credit. Thanks goes to Michael Lustfield (MTecknology) and Jon Kolb (kolbyjack).

Recent notes: Mailman with Nginx 1.0.4 on Ubuntu 10.04

The above configuration almost worked. Here are the things I changed to get my installation to run, some of which are needed and others of which are just cosmetic.

If you make root /usr/lib/cgi-bin as above, then in the Mailman config file mm_cfg.py you should change the default URL pattern and private archive URL like so:

DEFAULT_URL_PATTERN = 'http://%s/mailman/'
PRIVATE_ARCHIVE_URL = '/mailman/private'

Then your administration page URLs would skip cgi-bin, and would be accessed as, e.g. 'http://lists.DOMAIN.TLD/mailman/listinfo/<listname>'.

My final working 'location /mailman' section is given below. I went through many nonworking iterations, so I'm not sure which of the differences are significant except one related to the fastcgi parameters file, mentioned below.

        location /mailman {
                fastcgi_split_path_info ^(/mailman/[^/]*)(/.*)$;
                include mailman_fastcgi_params;
                fastcgi_param SCRIPT_FILENAME   $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
                fastcgi_intercept_errors on;
                fastcgi_pass unix:/var/run/fcgiwrap.socket;

I copied the distributed fastcgi_params file, then modified it by stripping out duplicates of those parameters set above, but I also removed the setting of REDIRECT_STATUS at the bottom, which should only be used with PHP. I think it was removing REDIRECT_STATUS that finally allowed my installation to work correctly.