This tutorial is all about how to install mailman3 in a Debian server with Apache2, and how to migrate existing lists from older mailman versions. It is intended specifically for sysadmins, and users in general who are curious of how machines and networks work. It assumes that postfix (a Mail Transport Agent, aka MTA) and mailutils are already installed in the system and configured, and the system can send emails, e.g the root user is sending admin related emails. It also assumes that python3, postgresql and apache2 are installed in the system too. Postfix is one of the possible MTA to be configured with mailman3. Detailed steps for configuring a fresh postfix install and few other MTA options, are included in the official mailman3 docs.
Install Dependency Libraries
We SSH to the remote server and as root do a system update with apt update && apt upgrade. Then we can install some system-wide dependencies for python development tools, python virtual environment, a CSS compressor and an HTML to plaintext convertor:
mailman-web provides hyperkitty and postorius for the web interface, as well as shortcuts to django admin commands. We install gunicorn for mailman-web application to be able to talk with apache2 server gateway, and a python client to make use of memory caching:
pip install pylibmc gunicorn
Mailman and hyperkitty configurations
Exit mailman user and as root we create
/etc/mailman3/ directory, we make owner of this directory the user mailman, and create under it the files mailman.cfg and settings.py. Then as mailman user again, we create the mailman-hyperkitty.cfg file under the /opt/mailman.
# The base_url should correspond with the apache2 links we configure laterbase_url: http://localhost/archives# Shared API key, must be the identical to the value the same as in the /etc/mailman3/settings.py api_key: SecretArchiverAPIKey
if postfix is already installed skip that step and just edit the postfix/main.cf with the sample in the above step.
Configure mailman-web UI
Mailman web is a django site, which includes postorius and hyperkitty (that we installed before in our virtualenv).
Enter mailman user again and run migrations, collect static files for the mailman-web, and create a django admin superuser, see details.
We visit the domain name we configured before we apache2. If the lists have a public view permission, then they are listed on the landing page. The same goes with the archives.
Old members of the migrated list, would need to create new accounts via this web UI, in order for them to access the archives and their email and list settings. They need to use the same email with which they had subscribed in the old list.