How to deploy mailman suite on debian vps for automated mailing list managementThis article provides a detailed step-by-step guide demonstrating how to deploy Mailman Suite on Debian VPS for automated mailing list management. Mailman Suite includes Mailman Core, Postorius (web UI), HyperKitty (archiver), and the Mailman Web UI integration.

What is Mailman Suite?

Mailman Suite is the full-featured version of GNU Mailman, an open-source software package for managing electronic mail discussion and e-newsletter lists.

Core Components of Mailman Suite:

  1. Mailman Core
    The backend engine that handles:

    • Subscription management
    • Message delivery
    • Archiving
    • Moderation
    • Bounce processing
  2. Postorius
    A modern web-based user interface for list administrators and moderators to manage lists via a browser.
  3. HyperKitty
    A web-based archiver that displays mailing list archives in a user-friendly, searchable format.
  4. Mailman Client
    A Python library used to interact programmatically with Mailman Core’s REST API.

What It’s For:

Mailman Suite is used to run mailing lists, especially for:

  • Online communities
  • Academic or research groups
  • Non-profits and open-source projects
  • Internal team communications

It supports features like:

  • Moderation and privacy controls
  • Role-based permissions
  • Archiving and searching list discussions
  • REST API for integration

Why Use Mailman Suite (Instead of Mailman 2.x):

  • Mailman Suite is Mailman 3.x – a modernized, modular, and web-enabled redesign.
  • It replaces the aging Mailman 2.x, which lacked a proper web UI and had monolithic architecture.

In short: Mailman Suite = modern mailing list management with full web UI and API support.

✅ System Requirements

Launch 100% ssd debian vps from $2. 49/mo!

How to Deploy Mailman Suite on Debian VPS for Automated Mailing List Management

To deploy Mailman Suite on Debian VPS for automated mailing list management, simply follow the steps below:

  1. 📦 Update System and Install Dependencies

    Login as root via SSH and run the following commands to bring your freshly installed Debian VPS up-to-date:

    sudo apt update && sudo apt upgrade -y sudo apt install python3 python3-venv python3-pip git build-essential \ libffi-dev libssl-dev libxml2-dev libxslt1-dev \ zlib1g-dev libjpeg-dev libpq-dev \ postgresql postgresql-contrib \ nginx supervisor curl
  2. 🐍 Create a Mailman User and Directory

    sudo adduser --disabled-password --gecos "" mailman sudo mkdir -p /opt/mailman sudo chown mailman:mailman /opt/mailman
  3. 📥 Install Mailman Suite via Mailman-Bundler

    Switch to the mailman user:

    sudo -i -u mailman cd /opt/mailman git clone https://gitlab.com/mailman/mailman-bundler.git cd mailman-bundler python3 -m venv venv source venv/bin/activate pip install -U pip setuptools pip install -r requirements.txt

    Build Mailman Suite:

    ./bin/mailman-bundler install
  4. 🛠️ Configure Database (PostgreSQL)

    Back as root:

    sudo -u postgres psql

    Inside psql shell:

    CREATE USER mailman WITH PASSWORD 'your_strong_password'; CREATE DATABASE mailmandb OWNER mailman; \q

    Back as mailman user, edit the config:

    nano /opt/mailman/mailman-bundler/mailman-suite-production.py

    Add:

    DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'mailmandb', 'USER': 'mailman', 'PASSWORD': 'your_strong_password', 'HOST': 'localhost', 'PORT': '', } }
  5. 🔧 Configure Mailman Core

    nano /opt/mailman/var/etc/mailman.cfg

    Set values like:

    [database] class: mailman.database.postgresql.PostgreSQLDatabase url: postgres://mailman:your_strong_password@localhost/mailmandb [webservice] hostname: 127.0.0.1 port: 8001
  6. 🌐 Configure Postorius and HyperKitty

    Still as mailman user:

    cd /opt/mailman/mailman-bundler source venv/bin/activate python manage.py migrate python manage.py createsuperuser python manage.py collectstatic
  7. 👁️ Configure uWSGI and Supervisor

    Create Supervisor config /etc/supervisor/conf.d/mailman.conf:

    [program:mailman-core] command=/opt/mailman/mailman-bundler/venv/bin/mailman start --foreground directory=/opt/mailman user=mailman autostart=true autorestart=true [program:mailman-web] command=/opt/mailman/mailman-bundler/venv/bin/uwsgi --http :8000 --module mailman_web.wsgi directory=/opt/mailman/mailman-bundler user=mailman autostart=true autorestart=true

    Then reload and start services:

    sudo supervisorctl reread sudo supervisorctl update
  8. 🌍 Configure Nginx Reverse Proxy

    sudo nano /etc/nginx/sites-available/mailman

    Example config:

    server { listen 80; server_name mail.example.com; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }

    Enable and reload:

    sudo ln -s /etc/nginx/sites-available/mailman /etc/nginx/sites-enabled/ sudo nginx -t && sudo systemctl reload nginx
  9. 📬 Configure Your MTA (e.g., Postfix)

    Ensure mailman.cfg has smtp settings for localhost, then configure Postfix to pipe list mail to Mailman.

    Example /etc/postfix/main.cf additions:

    alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases

    Create /etc/aliases entries for lists (later).

  10. 🧪 Test Setup

    • Visit http://mail.example.com to access the Mailman UI
    • Log in with the superuser created earlier
    • Create a new list and test mail flow
    • Run this to verify Mailman:
    sudo -u mailman /opt/mailman/mailman-bundler/venv/bin/mailman info
    
  11. 🔒 Enable HTTPS

    Use Let’s Encrypt:

    sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d mail.example.com

📌 Notes

  • Replace mail.example.com with your domain
  • Secure PostgreSQL (e.g., pg_hba.conf changes)
  • Use fail2ban and firewall for hardening

Here’s how to set up email piping for Mailman 3 and configure the necessary DNS records to ensure proper mail delivery and list functionality.

📬 PART 1: Email Piping Configuration (Postfix + Mailman 3)

  1. Enable LMTP in mailman.cfg

    Mailman 3 communicates with the MTA via LMTP.

    Edit /opt/mailman/var/etc/mailman.cfg:

    [runner.lmtp] type: LMTP socket_path: /opt/mailman/var/lmtp.sock

    Ensure Mailman is restarted to apply this:

    sudo supervisorctl restart mailman-core
  2. Configure Postfix to Use LMTP Socket

    Edit /etc/postfix/main.cf and add:

    transport_maps = hash:/etc/postfix/transport local_recipient_maps =

    Then create /etc/postfix/transport:

    lists.example.com mailman:

    Replace lists.example.com with your list domain.

    Generate the transport DB:

    sudo postmap /etc/postfix/transport
  3. Add Mailman Transport to master.cf

    Edit /etc/postfix/master.cf and append:

    mailman unix - n n - - lmtp -o lmtp_destination_recipient_limit=1 -o lmtp_sasl_auth_enable=no -o lmtp_tls_security_level=none -o lmtp_lhlo_name=localhost -o lmtp_connect_timeout=30s -o lmtp_cache_connection=no -o lmtp_bind_address=127.0.0.1 -o lmtp_host_lookup=no -o lmtp_destination_concurrency_limit=1 -o lmtp_destination_recipient_limit=1 -o lmtp_lmtp_socket=/opt/mailman/var/lmtp.sock

    Restart Postfix:

    sudo systemctl restart postfix
  4. Create Aliases (Optional, if not using LMTP + transport)

    If using traditional alias piping (instead of LMTP), add to /etc/aliases:

    testlist: "|/opt/mailman/mailman-bundler/venv/bin/mailman inject testlist@example.com"

    Then:

    sudo newaliases

    But LMTP + transport maps is preferred for Mailman 3.

🌐 PART 2: DNS Configuration for Mailman Lists

INFO: You must replace the following values:

  • lists.example.com -> Replace with your Mailman hostname
  • 123.123.123.123 -> Replace with the IPv4 address of your Mailman server
  • 2606:abcd:1234::1 -> Replace with the IPv6 address of your Mailman server

To send and receive mail reliably, update DNS as follows:

  1. MX Record

    lists.example.com. IN MX 10 mail.lists.example.com.

    Point to your mail server (could be the same VPS or external).

  2. SPF Record (TXT)

    lists.example.com. IN TXT "v=spf1 ip4:123.123.123.123 ~all"

    Replace 123.123.123.123 with your VPS IP. Include any other sending services (e.g., include:mailgun.org).

  3. DKIM

    • Install OpenDKIM
    • Generate keys for mail._domainkey.lists.example.com
    • Add public key in DNS:
    mail._domainkey.lists.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSq..."
    
  4. DMARC Record (Optional but Recommended)

    _dmarc.lists.example.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@lists.example.com"
  5. A and AAAA Records

    lists.example.com. IN A 123.123.123.123 lists.example.com. IN AAAA 2606:abcd:1234::1 (if available)
  6. PTR Record (Reverse DNS)

    Follow this guide to update PTR/rDNS for VPS hosted with Rad Web Hosting: How to Update rDNS For Cloud VPS and Dedicated Servers

    123.123.123.123 => lists.example.com

✅ Final Testing

  • Test receiving list emails: send to listname@lists.example.com
  • Check logs:
  • /var/log/mail.log (Postfix)
  • /opt/mailman/var/logs/
  • Use tools like MXToolbox to verify SPF, DKIM, DMARC

Launch 100% ssd debian vps from $2. 49/mo!

Conclusion

You now know how to deploy Mailman Suite on Debian VPS.

Share this:
Avatar of editorial staff

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX.
lg