FAQ

Page Discussion History

Difference between revisions of "Mailman"

(Mailman)
 
(7 intermediate revisions by one user not shown)
Line 3: Line 3:
 
[http://www.gnu.org/software/mailman/index.html 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.
 
[http://www.gnu.org/software/mailman/index.html 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.
+
Mailman is crazy. This page used to focus on giving you options to install, configure, and run it as you wish. Because of the crazy that is mailman, this will show you the most common and best supported way to set up Mailman software behind Nginx.
  
 
== Installation ==
 
== Installation ==
Line 9: Line 9:
 
To install mailman from the Ubuntu repository:
 
To install mailman from the Ubuntu repository:
 
<geshi lang="bash">
 
<geshi lang="bash">
aptitude install mailman
+
aptitude install mailman thttpd
 
</geshi>
 
</geshi>
  
Line 22: Line 22:
 
<geshi lang="nginx">
 
<geshi lang="nginx">
 
server {
 
server {
         server_name DOMAIN.TLD;
+
        listen XXX.XXX.XXX.XXX:80;
 +
         server_name lists.DOMAIN.TLD;
 
         root /usr/lib;
 
         root /usr/lib;
  
 
         location = / {
 
         location = / {
                 rewrite ^ /cgi-bin/mailman/listinfo permanent;
+
                 rewrite ^ /mailman/listinfo permanent;
 
         }
 
         }
  
 
         location / {
 
         location / {
                 rewrite ^ /cgi-bin/mailman$uri;
+
                 rewrite ^ /mailman$uri?$args;
 
         }
 
         }
  
         location /mailman {
+
         location = /mailman/ {
                 rewrite ^ /cgi-bin$uri$args? permanent;
+
                 rewrite ^ /mailman/listinfo permanent;
 
         }
 
         }
  
         location /cgi-bin/mailman {
+
         location /mailman/ {
                 include fastcgi_params;
+
                 include proxy_params;
                 proxy_pass http://127.0.0.1:8000;
+
                 proxy_pass http://127.0.0.1/;
                 #fastcgi_pass unix:/var/run/fcgiwrap.socket;   # Use this instead of proxy_pass if using fcgiwrap. See below.
+
                 proxy_set_header Host $host;
 +
                proxy_set_header X-Real-IP $remote_addr;
 +
        }
 +
 
 +
        location /cgi-bin {
 +
                rewrite ^/cgi-bin(.*)$ $1 permanent;
 
         }
 
         }
  
Line 58: Line 64:
 
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.
 
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.
+
Here, we're using thttpd. Edit the configuration file and make it match this exactly.
 
+
To use thttpd-
+
  
 
/etc/thttpd/thttpd.conf:
 
/etc/thttpd/thttpd.conf:
 
<geshi lang="text">
 
<geshi lang="text">
 
host=127.0.0.1
 
host=127.0.0.1
port=8000
+
port=80
dir=/usr/lib
+
dir=/usr/lib/cgi-bin/mailman
 
nochroot
 
nochroot
 
user=www-data
 
user=www-data
Line 74: Line 78:
 
</geshi>
 
</geshi>
  
 +
== Removing /cgi-bin/ from URL ==
  
If using [[fcgiwrap]], you will want your mailman location block to look like this:
+
Edit /usr/lib/mailman/Mailman/mm_cfg.py and change the following parameters.
 
+
<geshi lang="python">
<geshi lang="nginx">
+
DEFAULT_URL_PATTERN = 'http://%s/mailman/'
        location ~ ^/cgi-bin/mailman(/[^/]*)(/.*)?$ {
+
PRIVATE_ARCHIVE_URL = '/mailman/private'
                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;
+
        }
+
 
</geshi>
 
</geshi>
  
Look at the [[fcgiwrap]] page for help setting up that tool.
+
== Sum It Up ==
  
== Credits ==
+
There's a lot to making mailman work. It's definitely not a simple clickety click process. If you follow the above to the letter, there's no reason you shouldn't wind up with a fully functioning mailman installation.
  
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).
+
== Fixing Things ==
  
== Recent notes: Mailman with Nginx 1.0.4 on Ubuntu 10.04 ==
+
If you end up running into an issue where you have to authenticate for every link clicked in the admin interface, you may have changed the URI. This would happen if you are migrating from Apache or something else to Nginx. You can either try to match what you were using previously by manipulating the location blocks and thttpd config so the /mailman or the /cgi-bin/mailman will be passed to mailman. The other option is to run the command below.
  
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:
+
<geshi lang="bash">
 
+
while read list stuff; do withlist -l -r fix_url "$list"; done < <(list_lists)
<geshi lang="python">
+
DEFAULT_URL_PATTERN = 'http://%s/mailman/'
+
PRIVATE_ARCHIVE_URL = '/mailman/private'
+
 
</geshi>
 
</geshi>
  
Then your administration page URLs should skip cgi-bin, and would be accessed as, e.g. 'http://lists.DOMAIN.TLD/mailman/listinfo/<listname>'.
+
This will clear that cache and let you access things normally again.
 
+
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.
+
 
+
<geshi lang="nginx">
+
        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;
+
        }
+
</geshi>
+

Latest revision as of 22:35, 17 January 2012

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.

Mailman is crazy. This page used to focus on giving you options to install, configure, and run it as you wish. Because of the crazy that is mailman, this will show you the most common and best supported way to set up Mailman software behind Nginx.

Installation

To install mailman from the Ubuntu repository:

aptitude install mailman thttpd

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 {
        listen XXX.XXX.XXX.XXX:80;
        server_name lists.DOMAIN.TLD;
        root /usr/lib;
 
        location = / {
                rewrite ^ /mailman/listinfo permanent;
        }
 
        location / {
                rewrite ^ /mailman$uri?$args;
        }
 
        location = /mailman/ {
                rewrite ^ /mailman/listinfo permanent;
        }
 
        location /mailman/ {
                include proxy_params;
                proxy_pass http://127.0.0.1/;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
        }
 
        location /cgi-bin {
                rewrite ^/cgi-bin(.*)$ $1 permanent;
        }
 
        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.

Here, we're using thttpd. Edit the configuration file and make it match this exactly.

/etc/thttpd/thttpd.conf:

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

Removing /cgi-bin/ from URL

Edit /usr/lib/mailman/Mailman/mm_cfg.py and change the following parameters.

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

Sum It Up

There's a lot to making mailman work. It's definitely not a simple clickety click process. If you follow the above to the letter, there's no reason you shouldn't wind up with a fully functioning mailman installation.

Fixing Things

If you end up running into an issue where you have to authenticate for every link clicked in the admin interface, you may have changed the URI. This would happen if you are migrating from Apache or something else to Nginx. You can either try to match what you were using previously by manipulating the location blocks and thttpd config so the /mailman or the /cgi-bin/mailman will be passed to mailman. The other option is to run the command below.

while read list stuff; do withlist -l -r fix_url "$list"; done < <(list_lists)

This will clear that cache and let you access things normally again.