Mailman 3 with Ubuntu 26.04 and Migration
The following article addresses various aspects related to a Mailman 3 installation. First, we will show how Mailman 3 can be installed as easily as possible with MariaDB, Nginx, Postfix, and Hyperkitty using APT on Ubuntu 26.04 Server. Next, we will examine various aspects of the configuration and demonstrate which settings should be configured.
Set Variables
SITE_OWNER=me@lists.vbox.local" WEB_HOST="lists.vbox.local" MAIL_DOMAIN="lists.vbox.local"Install and Configure MariaDB
Installation Using APT
apt install -y mariadb-serverOptimize MariaDB for Use with Mailman 3
cat >/etc/mysql/mariadb.conf.d/99-mailman.cnf <<'EOF' [mysqld] innodb_file_per_table=1 innodb_buffer_pool_size=512M innodb_log_file_size=256M max_allowed_packet=256M character-set-server=utf8mb4 collation-server=utf8mb4_unicode_ci EOFInstall Additional Required Packages
apt install -y dbconfig-mysql apt install -y python3-mysqldb apt install -y python3-pymysqlInstall Mailman 3
apt install -y mailman3-fullFor a local test installation, the following questions can be answered as shown below. For regular operation, they must be specific circumstances.
Postfix
- General mail configuration type
- 5 = Local only
- System mail name
- lists.vbox.local
Mailman3
- Configure database for mailman3 with dbconfig-common?
- Yes
- MySQL application password for mailman3
- Leave blank OR specify your own password
- Password confirmation
- Repeat password if necessary
- Password of the database’s administrative user?
- Leave blank
Mailman3-Web
- Configure database for mailman3-web with dbconfig-common?
- yes
- MySQL application password for mailman3-web?
- Leave blank OR specify your own password
- Password confirmation
- Repeat password if necessary
- Password of the database’s administrative user
- Leave blank
- General mail configuration type
Complete the database configuration
dpkg --configure -aRestart services
systemctl restart mailman3 systemctl restart mailman3-webSet the Site Owner
sed -i \ "s/^site_owner:.*/site_owner: ${SITE_OWNER}/" \ /etc/mailman3/mailman.cfgsystemctl restart mailman3Configure Postfix
postconf -e \ 'relay_domains=hash:/var/lib/mailman3/data/postfix_domains' postconf -e \ 'transport_maps=hash:/var/lib/mailman3/data/postfix_lmtp' systemctl reload postfixConfigure Mailman Web
Here, the sample configuration mailman.example.com is replaced with the correct data.
mkdir -p /var/log/nginx/mailman3 touch /var/log/nginx/mailman3/access.log touch /var/log/nginx/mailman3/error.log sed -i \ "s/server_name mailman.example.com;/server_name ${WEB_HOST};/" \ /etc/mailman3/nginx.conf ln -sf \ /etc/mailman3/nginx.conf \ /etc/nginx/conf.d/mailman3.conf rm -f /etc/nginx/sites-enabled/default nginx -t systemctl reload nginxCreate a Mailman Web superuser
Here, you must assign a password for the web admin.
mailman-web createsuperuser \ --username admin \ --email "${SITE_OWNER}"Configure the Django site
cd /usr/share/mailman3-web python3 manage.py shell -c " from django.contrib.sites.models import Site s = Site.objects.get(id=1) s.domain='${WEB_HOST}' s.name='${WEB_HOST}' s.save() print(list(Site.objects.values())) " systemctl restart mailman3-web