How to Install Mailman on Fedora Server Latest

Mailman is a free and open-source mailing list management software that allows you to create and manage email lists for your organization, company or personal use. In this tutorial, we will show you how to install Mailman on a Fedora Server Latest.

Prerequisites

Step 1: Install Required Packages

Before installing Mailman on your server, you need to install the required packages, including Python 3, MySQL or PostgreSQL, and Apache or Nginx.

To install, open a terminal and run the following command:

sudo dnf install python3 mysql-server mysql-devel nginx

Step 2: Install Mailman

To install Mailman on your server, you need to download the latest Mailman source code from the official website.

  1. Open a terminal and change the working directory to /usr/local/src/.
cd /usr/local/src/
  1. Download the Mailman source code using the following command:
sudo wget -c https://files.pythonhosted.org/packages/source/m/mailman/mailman-2.1.34.tgz
  1. Extract the downloaded file using the following command:
sudo tar xzvf mailman-2.1.34.tgz
  1. Change the working directory to the extracted folder.
cd mailman-2.1.34
  1. To check for required packages, run the bin/check_perms script.
sudo bin/check_perms
  1. If everything is correct, you can start the installation process by running the following command:
sudo python3 setup.py install
  1. After the installation process has finished, you need to run the configure script under the mailman/bin/ directory.
cd /usr/local/src/mailman-2.1.34/mailman/bin
sudo ./configure --with-python=/usr/bin/python3
  1. Modify the permission of mailman directories and files.
cd /usr/local/src/mailman-2.1.34/
sudo chmod -R 2775 ./mailman
sudo chown -R root:mailman ./mailman
sudo chmod -R g+w ./mailman

Step 3: Configure Mailman

After installing Mailman on your server, you need to configure it before you can use it.

  1. To configure Mailman, open the mm_cfg.py file under the mailman directory.
sudo vim /usr/local/mailman/mm_cfg.py
  1. Find the following two lines and modify them as shown.
VIRTUAL_HOSTS.clear()
DEFAULT_URL_HOST = 'your-domain.com'
  1. Save and close the file.

  2. Verify Postfix's main.cf and master.cf files, then add the following settings at the end of the main.cf file.

relay_domains = lists.your-domain.com
transport_maps = hash:/etc/postfix/transport
  1. Run the following command to create the transport map file:
sudo touch /etc/postfix/transport
  1. Edit the transport map file as follows:
lists.your-domain.com mailman:
  1. Run the following commands to rebuild the transport map database and restart Postfix:
sudo postmap /etc/postfix/transport
sudo systemctl restart postfix
  1. Modify the mm_cfg.py file to reflect the following changes:
MTA = 'Postfix'
SMTPHOST = '127.0.0.1'
SMTPPORT = 25
  1. Save and close the file.

Step 4: Set Up Mailman Web Interface

To set up the Mailman web interface, you need to configure your web server to serve the Mailman web interface.

For Nginx:

  1. Create a new configuration file for the Mailman web interface:
sudo vim /etc/nginx/conf.d/mailman.conf
  1. Add the following configuration to the file:
server {
    listen 80;
    server_name lists.your-domain.com;

    access_log  /var/log/nginx/mailman_access.log;
    error_log   /var/log/nginx/mailman_error.log;

    location / {
        proxy_pass http://127.0.0.1:8001/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        fastcgi_pass unix:/run/mailman-runner.sock;
        include     fastcgi_params;
    }

    location /icons/ {
        alias       /usr/share/icons/mailman;
    }
}
  1. Save and close the file.

  2. Restart Nginx service:

sudo systemctl restart nginx

For Apache:

  1. Create a new virtual host configuration file:
sudo vim /etc/httpd/conf.d/mailman.conf
  1. Add the following configuration to the file:
Listen 8001

<VirtualHost *:8001>
    ServerName lists.your-domain.com
    DocumentRoot "/usr/local/mailman/cgi-bin/"

    <Directory "/usr/local/mailman/cgi-bin/">
        Options +ExecCGI
        AddHandler cgi-script .cgi
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>

    ScriptAlias /icons/ /usr/share/icons/mailman/
    Alias /pipermail/ /usr/local/mailman/archives/public/

    <Directory "/usr/local/mailman/archives/public/">
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>

    <Location /mailman>
        AuthType Basic
        AuthName "Mailman"
        AuthBasicProvider manager
        Require valid-user
        LogLevel debug
        ErrorLog /var/log/httpd/mailman-error.log
        CustomLog /var/log/httpd/mailman-access.log combined
    </Location>
</VirtualHost>
  1. Save and close the file.

  2. Restart Apache service:

sudo systemctl restart httpd

Conclusion

In this tutorial, we have shown you how to install Mailman on a Fedora Server Latest. We have also demonstrated how to configure and set up the Mailman web interface on both Nginx and Apache web servers.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!