From ArchWiki
(Redirected from Mailman 3)

Mailman is a mailing list management system. It is used in conjunction with a mail server.


Install the mailman3 package.

Note: mailman3 will replace mailmanAUR[broken link: package not found] in the near future. As both applications make use of /var/lib/mailman as state directory and the mailman user, they currently conflict and can not be installed alongside each other.

Mailman can be used in conjunction with Postorius (for configuration) and Hyperkitty (for archiving).

Note: Mailman runs as a dedicated mailman user, therefore any calls to the mailman executable have to be done as the mailman user.


All configuration for Mailman takes place in /etc/mailman.cfg. The schema explaining all possible configuration options and setting the defaults is stored in /usr/lib/python3.8/site-packages/mailman/config/schema.cfg.

The configuration is also accessible via the command line. Run the following command as the mailman user (e.g. using sudo or su):

[mailman]$ mailman conf


Mailman by default uses an SQLite database in /var/lib/mailman/data/, but can be configured to use MariaDB or PostgreSQL.


The default location for the SQLite database is already reflected in the schema.cfg and therefore does not have to be set in Mailman's configuration.

url: sqlite:////var/lib/mailman/data/mailman.db


Install the python-pymysql package and configure a database on MariaDB.

class: mailman.database.mysql.MySQLDatabase
url: mysql+pymysql://myuser:mypassword@mymysqlhost/mailman?charset=utf8&use_unicode=1


Install the python-psycopg2 package and create a database using PostgreSQL.

class: mailman.database.postgresql.PostgreSQLDatabase
url: postgres://myuser:mypassword@mypghost/mailman


Mailman exposes its REST API based on the settings in the [webservice] section of the configuration. Make sure to replace the default values for admin_user and admin_pass (do not use the example values below).

admin_user: my_new_admin_user_name
admin_pass: my_new_admin_user_password


By default DMARC and DKIM are disabled. The configuration takes place in the [ARC] section of the configuration file. Make sure to set necessary values and read the documentation about the defaults.

enabled: yes
authserv_id: mailserver.tld
trusted_authserv_ids: subdomain.mailserver.tld, other.mailserver.tld
privkey: /path/to/privatekey.pem
selector: test
domain: mailserver.tld


To connect a mail-transfer-agent (MTA), it is necessary to configure the [mta] section in the configuration file. Upstream documentation covers examples for postfix, exim and sendmail, but other MTAs are technically possible.


To connect to a local postfix instance the following configuration section can be used:

incoming: mailman.mta.postfix.LMTP
outgoing: mailman.mta.deliver.deliver
lmtp_port: 8024
smtp_port: 25

The postfix configuration has to be extended to ensure compatibility (see upstream notes).


recipient_delimiter = +
unknown_local_recipient_reject_code = 550
owner_request_special = no

Additionally, postfix needs to be made aware of mailman's transport maps. Depending on the postfix configuration these may look similar to the following.

Note: The following examples assume that existing values for transport_maps, local_recipient_maps, relay_domains, virtual_mailbox_domains and virtual_alias_maps are merged with the additional values.

transport_maps = hash:/var/lib/mailman/data/postfix_lmtp
local_recipient_maps = hash:/var/lib/mailman/data/postfix_lmtp
relay_domains = hash:/var/lib/mailman/data/postfix_domains

If postmap is not directly accessible by mailman for creating the default hash-based alias maps, it is possible to generate regular expression based alias maps instead. To overwrite the default Python-class based configuration, mailman allows the use of a configuration file. Create the following file:

postmap_command: /usr/bin/postmap
transport_file_type: regex

Add the file to the [mta] section in mailman's configuration file.

configuration: /etc/postfix-mailman.cfg

Afterwards the regexp based exports can then be used in the postfix configuration.


transport_maps = regexp:/var/lib/mailman/data/postfix_lmtp
local_recipient_maps = regexp:/var/lib/mailman/data/postfix_lmtp
relay_domains = regexp:/var/lib/mailman/data/postfix_domains

Note: Make sure to create the new alias maps after changing their type (e.g. from hash to regexp): [mailman]$ mailman aliases

To connect to a local postfix instance with a virtual mail setup, first set an alias domain. Afterwards alter the respective configuration.


local_recipient_maps = regexp:/var/lib/mailman/data/postfix_lmtp
transport_maps = regexp:/var/lib/mailman/data/postfix_lmtp
virtual_mailbox_domains = regexp:/var/lib/mailman/data/postfix_domains
virtual_alias_maps = regexp:/var/lib/mailman/data/postfix_vmap


Enable and start mailman3.service.

Several systemd services with timers exist, taking care of various aspects of the list management:

  • mailman3-digests.timer: for sending out daily digests to subscribers
  • mailman3-gatenews.timer: for hourly polling of NNTP servers for news
  • mailman3-notify.timer: for sending out daily notifications to admins about pending requests


Integrate with a mail server

This article or section needs expansion.

Reason: Example for setup with mail server (based on upstream documentation). (Discuss in Talk:Mailman)

Integrate with Hyperkitty

Mailman does not automatically archive mails on its own. The Hyperkitty web application is used for this purpose. Based on a plugin, mailman is able to send mails to a Hyperkitty instance for archival.

Install the mailman3-hyperkitty package and configure /etc/mailman-hyperkitty.cfg.

base_url: https://example.tld/hyperkitty/
api_key: super_secret_password

Afterwards, make mailman aware of the plugin:

class: mailman_hyperkitty.Archiver
enable: yes
configuration: /etc/mailman-hyperkitty.cfg

Tips and tricks

Migrate from mailman < 3.0

Mailman offers the possibility of importing mailman < 3.0 based list databases (config.pck). Run the following command as the mailman user (e.g. using sudo or su):

[mailman]$ mailman import21 LISTSPEC PICKLE_FILE

Here, LISTSPEC represents a fully-qualified name of a list to import (e.g. and PICKLE_FILE the path to the list's config.pck file.

Note: The mailman2 list to be imported must already exist on the target mailman instance.


Mailman exposes a REST API, which can be interfaced using custom tooling, based on python-mailmanclient.

See also