FAQ

Page Discussion History

Mailman

Revision as of 16:57, 11 January 2012 by MichaelLustfield (Talk | contribs)

Contents

Mailman

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.

Installation

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.good-sam.com;
        root /usr/lib;
 
        location = / {
                rewrite ^ /cgi-bin/mailman/listinfo permanent;
        }
 
        location / {
                rewrite ^ /cgi-bin/mailman$uri;
        }
 
        location /mailman {
                rewrite ^ /cgi-bin$uri$args? permanent;
        }
 
        location /cgi-bin/mailman {
                include proxy_params;
                #fastcgi_pass unix:/var/run/fcgiwrap.socket;
                proxy_pass http://127.0.0.1:8000;
                proxy_set_header Host $host;
        }
 
        location /images/mailman {
                alias /var/lib/mailman/icons;
        }
 
        location /pipermail {
                alias /var/lib/mailman/archives/public;
                autoindex on;
        }
}

CGI

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-

/etc/thttpd/thttpd.conf:

host=127.0.0.1
port=8000
dir=/usr/lib
nochroot
user=www-data
cgipat=/**
throttles=/etc/thttpd/throttle.conf
logfile=/var/log/thttpd.log


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

        location ~ ^/cgi-bin/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.

Credits

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

You can try to use /mailman/ instead of /cgi-bin/mailman/ but the authors of this page gave up and just accepted that extra. If you do try to do this, 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 should 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;
        }