Mailman3 Easy Installation

I made script to make mailman3 installation easy (automated) based on my experience installing it manually.  for installation guide and prerequisite condition you can see in it’s repository here

Here’s the post installation topics that may you need:

Creating Admin User

Run this command for create new admin user then follow the guide.

/opt/mailman3/conda/envs/mailman3_ext/bin/python /opt/mailman3/webui/ createsuperuser

Changing Postorius Port to 80/443

see my gist for nginx  configuration for listening to port 80 (http) that will be redirect to 443 (https) here . copy it then paste to nginx main configuration.

cat > /opt/mailman3/etc/nginx/nginx.conf

Restart service to apply the configuration.

service mailman3_webui restart

Change Self Sign Certificate

Please replace self sign certificate that created while installation in your commercial one. the ssl certificate located in /opt/mailman3/etc/nginx/certs

Disabling Archiving Service (hyperkitty)

Edit Django file configuration then give comment (#) for hyperkitty in INSTALLED_APPS

vim /opt/mailman3/webui/webui/

so the code moreless will be like this


Also edit urls configuration for hyperkitty app by give comment (#) on it.

vim /opt/mailman3/webui/webui/

the code will be like this.

urlpatterns = [
    url(r'^$', RedirectView.as_view(
    url(r'^postorius/', include('postorius.urls')),
    #url(r'^hyperkitty/', include('hyperkitty.urls')),

Disable archiver in mailman3 main configuration from enable: yes to enable: no

vim /opt/mailman3/etc/mailman.cfg

Restart services to apply new configuration

service mailman3 restart
service mailman3_webui restart

Change Lookup File Type to Regex

By default mailman3 will generating postfix’s hash file which is using postmap command so postfix must be installed, Do following steps  if you want to change to regex.

Add/adjust following config in mailman3 main configuration file (/opt/mailman3/etc/mailman3.cfg)

incoming: mailman.mta.postfix.LMTP
outgoing: mailman.mta.deliver.deliver
lmtp_port: 8023
smtp_host: localhost
smtp_port: 25
configuration: /opt/mailman3/etc/mailman_rgx.cfg

Create mailman3 regex configuration file, don’t forget to restart mailman3 service to apply.

cat > /opt/mailman3/etc/mailman_rgx.cfg

transport_file_type: regex
postmap_command: /opt/zimbra/postfix/sbin/postmap

The generated lookup file will be located in folder /opt/mailman3/var/data/postfix_lmtp, it’s will be added in every time you add new mail-list


11 thoughts on “Mailman3 Easy Installation

  1. Starting mailman3:
    /etc/init.d/mailman3: line 69: /opt/mailman3/conda/bin/mailman: No such file or directory
    /etc/init.d/mailman3: line 72: /opt/mailman3/conda/bin/mailman: No such file or directory


  2. Hi ya,
    I have the same error as Harris above. But I can see no errors in the commands that ran.

    When I look in that directory,


    then there is no file called mailman.

    Your automatic installation script is my best hope I’ve found to try to install Mailman 3, since every attempt I’ve made to follow instructions on the Mailman site, or on other people’s pages has met with failure…

    For your info I’m running
    Centos 7.2 (fresh install on a VPS)
    Centos Web Panel (as a front end for web management)

    This is the output:
    [root@srv mailman3]# python /opt/mailman3/
    Log file /tmp/tmpJ3vB36
    =============== Make sure epel repo has been installed
    Running command: yum install -y epel-release
    =============== Installing required packages (wget git-core gcc bzip2 xz gcc-c++ nginx openssl)
    Running command: yum install -y wget git-core gcc bzip2 xz gcc-c++ nginx openssl
    =============== Creating temporary (/root/mailman3_setup)
    Running command: mkdir -p /root/mailman3_setup
    =============== Create mandatory folders
    Running command: mkdir -p /opt/mailman3/var/{data/pid,logs}
    =============== Downloading miniconda (python3)
    Running command: wget -c -O /root/mailman3_setup/
    Running command: chmod +x /root/mailman3_setup/
    =============== Installing miniconda in /opt/mailman3/conda
    Running command: mkdir -p /opt/mailman3
    Running command: sh /root/mailman3_setup/ -b -p /opt/mailman3/conda
    =============== Create mailman3_core and mailman3_ext virtual environment
    Running command: /opt/mailman3/conda/bin/conda create –name mailman3_core -y
    Running command: /opt/mailman3/conda/bin/conda create –name mailman3_ext python=2 -y
    =============== Installing required python libs
    Running command: /opt/mailman3/conda/bin/pip install -r /opt/mailman3/misc/mailman3_core_requirements.txt
    Running command: /opt/mailman3/conda/envs/mailman3_ext/bin/pip install -r /opt/mailman3/misc/mailman3_ext_requirements.txt
    =============== Generating Certificate for HTTPS
    Running command: mkdir -p /opt/mailman3/etc/nginx/certs
    Running command: openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /opt/mailman3/etc/nginx/certs/ssl.key -out /opt/mailman3/etc/nginx/certs/ssl.cert -subj “/C=ID/ST=DKI Jakarta/L=South of Jakarta/O=JBT/OU=IT Department/”
    =============== Generating django secret key
    Running command: mkdir -p /opt/mailman3/webui/webui
    =============== Collecting static files for webui
    Running command: /opt/mailman3/conda/envs/mailman3_ext/bin/python /opt/mailman3/webui/ collectstatic –noinput
    =============== Migrating mailman3 webui database
    Running command: /opt/mailman3/conda/envs/mailman3_ext/bin/python /opt/mailman3/webui/ migrate
    =============== Installing int script for mailman3 core and webui
    Running command: cp /opt/mailman3/misc/mailman3_init /etc/init.d/mailman3
    Running command: cp /opt/mailman3/misc/mailman3_webui_init /etc/init.d/mailman3_webui
    You may create admin user by running following command
    /opt/mailman3/conda/envs/mailman3_ext/bin/python /opt/mailman3/webui/ createsuperuser

    to run mailman3 services:
    service mailman3 start
    service mailman3_webui start

    Further more please read mailman3 documentation (

    – Please change self sign certicate with commercial one.
    – if there are any issue,suggestion or forking visit this repo script


    Thanks for any help,


  3. Hi Iomar, I just did a clean install on Oracle 7 but I’m getting the following error creating the superuser:

    File “/opt/mailman3/conda/envs/mailman3_ext/lib/python3.7/site-packages/django/contrib/admin/”, line 151
    ‘%s=%s’ % (k, v) for k, v in params.items(),
    SyntaxError: Generator expression must be parenthesized


    The same error also shows up in the install log after the ssl.key is written. I suspect this is related to Python 3.7. Is there a way to specify a lower 3.x version for the install?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s