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
- A Fedora Server Latest instance
- A user account with sudo or root privileges
- Basic knowledge of the command line
- Python 3.6 or later
- Webserver (Apache or Nginx)
- MTA (Postfix or Exim)
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.
- Open a terminal and change the working directory to
/usr/local/src/.
cd /usr/local/src/
- 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
- Extract the downloaded file using the following command:
sudo tar xzvf mailman-2.1.34.tgz
- Change the working directory to the extracted folder.
cd mailman-2.1.34
- To check for required packages, run the
bin/check_permsscript.
sudo bin/check_perms
- If everything is correct, you can start the installation process by running the following command:
sudo python3 setup.py install
- After the installation process has finished, you need to run the
configurescript under themailman/bin/directory.
cd /usr/local/src/mailman-2.1.34/mailman/bin
sudo ./configure --with-python=/usr/bin/python3
- Modify the permission of
mailmandirectories 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.
- To configure Mailman, open the
mm_cfg.pyfile under themailmandirectory.
sudo vim /usr/local/mailman/mm_cfg.py
- Find the following two lines and modify them as shown.
VIRTUAL_HOSTS.clear()
DEFAULT_URL_HOST = 'your-domain.com'
Save and close the file.
Verify Postfix's
main.cfandmaster.cffiles, then add the following settings at the end of themain.cffile.
relay_domains = lists.your-domain.com
transport_maps = hash:/etc/postfix/transport
- Run the following command to create the transport map file:
sudo touch /etc/postfix/transport
- Edit the transport map file as follows:
lists.your-domain.com mailman:
- Run the following commands to rebuild the transport map database and restart Postfix:
sudo postmap /etc/postfix/transport
sudo systemctl restart postfix
- Modify the
mm_cfg.pyfile to reflect the following changes:
MTA = 'Postfix'
SMTPHOST = '127.0.0.1'
SMTPPORT = 25
- 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:
- Create a new configuration file for the Mailman web interface:
sudo vim /etc/nginx/conf.d/mailman.conf
- 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;
}
}
Save and close the file.
Restart Nginx service:
sudo systemctl restart nginx
For Apache:
- Create a new virtual host configuration file:
sudo vim /etc/httpd/conf.d/mailman.conf
- 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>
Save and close the file.
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.