Mailman 2

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.


This guide is for the older Mailman 2. Unless you have specific requirements, head over to the newer Mailman 3!


For this guide you should be familiar with the basic concepts of

  • Python

  • Folder/File Permissions


Mailman is released under the GNU General Public License


Your URL needs to be setup for web and mail:

[isabell@stardust ~]$ uberspace web domain list
[isabell@stardust ~]$ uberspace mail domain list
[isabell@stardust ~]$

Mailman requires dnspython. Install it using pip:

[isabell@stardust ~]$ pip install dnspython --user
Collecting dnspython
  Using cached
Installing collected packages: dnspython
Successfully installed dnspython
[isabell@stardust ~]$


Prepare folders

Prepare the installation folders:

[isabell@stardust ~]$ cd /var/www/virtual/$USER/
[isabell@stardust isabell]$ mkdir mailman_source mailman
[isabell@stardust isabell]$ chmod g+s mailman
[isabell@stardust isabell]$


Download the latest Mailman 2.1 version from and extract the archive in your webroot (replace the version numbers accordingly):

[isabell@stardust ~]$ cd /var/www/virtual/$USER
[isabell@stardust isabell]$ wget
[isabell@stardust isabell]$ tar xzvf mailman-2.1.29.tgz -C mailman_source --strip-components=1
[isabell@stardust isabell]$

Now run the configure script, telling Mailman where to install and what user/groups to use for its binaries. You need to change your Uberspace account name for each parameter (you can find a declaration for the parameters in the Mailman documentation):

[isabell@stardust ~]$ cd /var/www/virtual/$USER/mailman_source
[isabell@stardust mailman_source]$ ./configure --with-username=$USER --with-groupname=$USER --prefix=/var/www/virtual/$USER/mailman/ --with-mail-gid=$USER --with-cgi-gid=$USER
config.status: creating build/cron/nightly_gzip
config.status: creating build/cron/senddigests
config.status: executing default commands
configuration completed at Thu Nov 1 10:10:10 CET 2018
[isabell@stardust mailman_source]$

After configuration is finished, you may compile and install the package by running

[isabell@stardust ~]$ cd /var/www/virtual/$USER/mailman_source
[isabell@stardust mailman_source]$ make && make install
Compiling /var/www/virtual/isabell/mailman/Mailman/ ...
Upgrading from version 0x0 to 0x2011df0
getting rid of old source files
no lists == nothing to do, exiting
[isabell@stardust mailman_source]$

If compilation and installation finished without errors, we will no longer need the source files now, so clean them up:

[isabell@stardust ~]$ cd /var/www/virtual/$USER/
[isabell@stardust isabell]$ rm mailman-*.tgz
[isabell@stardust isabell]$ rm -fvr mailman_source
[isabell@stardust isabell]$

Check permissions

We can continue by checking folder permissions in the installation folder:

[isabell@stardust ~]$ cd /var/www/virtual/$USER/mailman
[isabell@stardust mailman]$ bin/check_perms
No problems found
[isabell@stardust mailman]$

In case errors are found, you should definitely fix them before continuing.

Enable web interface

If you want the webinterface to be public available, we need to create a couple of SymLinks and an htaccess-file:

[isabell@stardust ~]$ cd /var/www/virtual/$USER/html
[isabell@stardust html]$ ln -s /var/www/virtual/$USER/mailman/cgi-bin ./mailman
[isabell@stardust html]$ ln -s /var/www/virtual/$USER/mailman/archives/public ./pipermail
[isabell@stardust html]$ ln -s /var/www/virtual/$USER/mailman/icons ./icons
[isabell@stardust html]$

Create the file /var/www/virtual/$USER/mailman/cgi-bin/.htaccess with the following content:

Options +ExecCGI
SetHandler cgi-script

Finally, we need to adjust file permissions for the Mailman cgi-scripts to run:

[isabell@stardust ~]$ chmod -R 0755 /var/www/virtual/$USER/mailman/cgi-bin
[isabell@stardust ~]$

Configure qmail

Because Mailman doesn’t handle our .qmail-configuration automatically, we need to help it create the necessary aliases. This needs to be done for each new mailinglist, so we will create an extra script to process this task. Create the file ~/bin/ with the following content (this code is based on the script provided in the official installation instructions):

if [ $# = 1 ]; then
echo Making links to $i in home directory...
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman post $i" > ~/.qmail-$i
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman admin $i" > ~/.qmail-$i-admin
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman bounces $i" > ~/.qmail-$i-bounces
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman confirm $i" > ~/.qmail-$i-confirm
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman join $i" > ~/.qmail-$i-join
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman leave $i" > ~/.qmail-$i-leave
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman owner $i" > ~/.qmail-$i-owner
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman request $i" > ~/.qmail-$i-request
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman subscribe $i" > ~/.qmail-$i-subscribe
echo "|preline /var/www/virtual/$USER/mailman/mail/mailman unsubscribe $i" > ~/.qmail-$i-unsubscribe

You still need to make the script executable:

[isabell@stardust ~]$ chmod +x ~/bin/
[isabell@stardust ~]$

After creating a list via the webinterface, you can then run this script to create the required .qmail-files (like listname if you stored it as ~/bin/ and want to create aliases for a list listname).


By now we have installed all the necessary files - let’s tell them what they should actually do.


Create a mailbox for Mailman to use to send e-mails. In this example, we are going to use


Add the following options to the end of the file /var/www/virtual/$USER/mailman/Mailman/ (change values accordingly!):

# configure default domains to use for the webinterface and e-mail addresses

# configure mailmans mailbox
SMTPPORT = '587'

SMTP_PASSWD = 'MySuperSecretPassword'

# tell mailman to use HTTPS
DEFAULT_URL_PATTERN = 'https://%s/mailman/'

You can look up the meaning and default value of each variable in the file in the same folder.


Do not modify the as it may be overwritten on updates!

Finishing Installation

Install cronjobs

Mailman offers a couple of cronjobs to perform some maintenance actions at regular intervals. Additionally, there are some tasks that need to be run frequently (like checking mails). To install them for your user, run:

[isabell@stardust ~]$ cd /var/www/virtual/$USER/mailman
[isabell@stardust mailman]$ echo "* * * * * /var/www/virtual/$USER/mailman/bin/qrunner --runner=All --once" >> cron/
[isabell@stardust mailman]$ crontab cron/
[isabell@stardust mailman]$

Create the first mailinglist

Now we are ready to create the first mailing list! Simply run

[isabell@stardust ~]$ /var/www/virtual/$USER/mailman/bin/newlist mailman
Enter the email of the person running the list:
Initial test password:
Hit enter to notify test owner...
[isabell@stardust ~]$

and follow the on-screen instructions.


Don’t forget to create the .qmail-aliases using the ‘’ script afterwards!

Redirect HTTP-requests

If you don’t want a pesky HTTP 403 (Forbidden) error when someone calls, you can extend the .htaccess in /var/www/virtual/isabell/mailman/cgi-bin with the following lines and they will be redirected to the listinfo page:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} ^\/mailman\/$
RewriteRule .* mailman/listinfo [R=301,L]

All done! Enjoy using your new list manager available at!

This guide is based on the official Mailman 2.1 installation instructions.

Written by: Thomas Hoffmann <>, ezra <>