Introduction
By default, Mailman sends out links (e.g. initial invite to mailing lists) that are not secure as they use HTTP instead of HTTPS. You can change this per MailMan's documentation: 4.27. Securing Mailman's web GUI by using Secure HTTP/SSL (HTTPS).
In this article, we will detail how to adjust Mailman to force SSL on cPanel servers.
Step 1: Update the mm_cfg.py config file
First we'll need to update the configuration. Edit the file /usr/local/cpanel/3rdparty/mailman/Mailman/mm_cfg.py and add the following line underneath "# Put YOUR site-specific settings below this line":
DEFAULT_URL_PATTERN = 'https://%s/mailman/'
The change to mm_cfg.py will only apply to new lists. Old lists will need to be updated manually.
Step 2: Make sure cPanel updates don't overwrite the config file
Add /usr/local/cpanel/3rdparty/mailman/Mailman/mm_cfg.py to cpanelsync exclusionary file.
echo "/usr/local/cpanel/3rdparty/mailman/Mailman/mm_cfg.py" >> /etc/cpanelsync.exclude
Step 3: Identify the list you'll want to update
All of the existing lists are stored as folders in /usr/local/cpanel/3rdparty/mailman/lists/, with a format like "${listname}_${domain.com}". You can use the ls command to list the directory contents and identify the list you'll want to update from there:
[root@c74-68-0-23-1516007286 lists]# ls /usr/local/cpanel/3rdparty/mailman/lists/
mailman testlist_hb1.com
In this case, our list name is testlist_hb1.com and our domain is hb1.com. For the remainder of this article, you can change those values to match your own list name and domain.
Step 4: Update your existing list
To update a single existing list, you can run the following command where you swap out testlist_hb1.com with your list name and hb1.com with your domain. This command will also ensure that urls reflect the proper domain name instead of showing the hostname.
[root@c74-68-0-23-1516007286 lists]# sudo -u mailman /usr/local/cpanel/3rdparty/mailman/bin/withlist -l -r fix_url testlist_hb1.com --urlhost=hb1.com
Importing fix_url...
Running fix_url.fix_url()...
Loading list testlist_hb1.com (locked)
Saving list
Finalizing
Comments
0 comments
Article is closed for comments.