Using Mailman

Mailman is a mailing lists manager, an optional component on a mail server.

Mailman 2

Install mailman:

$ sudo apt install mailman

Configuration modifications for /etc/mailman/ are:

from Defaults import *
#DEFAULT_URL_PATTERN = 'http://%s/cgi-bin/mailman/'
DEFAULT_URL_PATTERN = 'https://%s/mailman/'
IMAGE_LOGOS         = '/images/mailman/'
PRIVATE_ARCHIVE_URL = '/mailman/private'
MTA = 'Postfix'

Mailman entry in /etc/postfix/master.conf is:

mailman   unix  -       n       n       -       -       pipe
flags=FR user=list argv=/usr/lib/mailman/bin/
${nexthop} ${user}

For nginx, the configuration for lists.conf should be like:

server {

          location /mailman {
          root  /usr/lib/cgi-bin;
          fastcgi_split_path_info (^/mailman/[^/]+)(/.*)$;
          fastcgi_pass  unix:///var/run/fcgiwrap.socket;
          include /etc/nginx/fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          fastcgi_param PATH_INFO       $fastcgi_path_info;
          location /images/mailman {
          alias /usr/share/images/mailman;
          location /pipermail {
          alias /var/lib/mailman/archives/public;
          autoindex on;

  listen 443 ssl;
  ssl_certificate /etc/letsencrypt/live/;
  ssl_certificate_key /etc/letsencrypt/live/;
  include /etc/letsencrypt/options-ssl-nginx.conf;
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

server {
  if ($host = {
      return 301 https://$host$request_uri;
  listen 80;
  return 404;

Set up a certbot certificate:

$ sudo certbot --nginx -d

Set a site password and the list creator password (more details):

$ sudo mmsitepass <your-site-password>
$ sudo mmsitepass -c <list-creator-password>


Mailman 3

Mailman 3 is in active developement, and –like Lino– uses Django for its web interface. The Mailman web interface consists of two Django apps, Postorious (lists management) and Hyperkitty (list archives), which may be used separately, or integrated into another Django project together with custom apps, or, –probably the most frequent use case– are combined into a Django project called the “Mailman Suite”. This is what we are going to install here.

Should we use the packaged version by saying sudo apt install mainman3-full? It seems that we prefer to use selected clones of the official git repository in order to be able to easily switch between versions. Though we didn’t yet fully explore the package approach (see 2020-08-13).

The following is not finished.

We assume that you have already installed and configured postfix (Postfix) and that your basic email system is working.

Get the sources

The mailman suite is like any other Lino site, except that the file is copied from

We assume that the master environment is installed (see Setting up a Lino production server).

Draft installation instructions with getlino:

$ sudo env PATH=$PATH getlino startsite --db-engine=postgresql std lists

Manually install mailman repository:

$ go mailman
$ a
$ mkdir env/repositories
$ cd $_
$ git clone
$ pip install -e mailman/
$ go mailman

Download config files from

$ mv
$ wget
$ wget

Install Python wrappers for using memcached and the Whoosh backend for HyperKitty archive search:

$ pip install pylibmc Whoosh

Tips and tricks

Add a new member on the command line

$ sudo add_members -r recipients.txt test


The following simulates quite closely what mailman does when sending its mails.

$ sudo apt install sendemail
$ dig MX
$ sendemail -f -t -u test -m test -s -v -o tls=no