How to clone a mailing list?

manuel75

Registered
Jun 8, 2020
1
0
0
Paris
cPanel Access Level
Website Owner
Hello,
I have setup several mailing lists from scratch and the option setup is heavy and error prone, unlike the members list, that can be imported easily as a flat list.
I need to setup a new list and would love to be able to simply clone an existing one and just change some members.
I didn't find that feature anywhere. Is it considered or is there a workaround?
 

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
Hello @manuel75

You can use the "/usr/local/cpanel/3rdparty/mailman/bin/config_list" script to print a mailing list's configuration variables. I'll outline a few steps that will help you accomplish this.

1. First make sure you have an existing mailing list with the options you require. You will need to note the exact name of the mailing list in the following directory:

Code:
-bash-4.2# ls /usr/local/cpanel/3rdparty/mailman/lists/
mailman  testlist_samsaccount.com

2. Then you can use the following command to backup the mailing list's options:

/usr/local/cpanel/3rdparty/mailman/bin/config_list -o testlist.config testlist_samsaccount.com

Where "testlist.config" is the filename of the configuration backup file that this script generates and "testlist_samsaccount.com" is the name of the mailing list you want to clone.

3. To clone this configuration to a new list, I would suggest that you first create a new mailing list in the cPanel interface. Once you have done so, you can then use the -i option with the config_list script, e.g.:

/usr/local/cpanel/3rdparty/mailman/bin/config_list -i testlist.config test2_samsaccount.com

Note, even if you want all settings to be exactly the same between the 2 lists, you might want to consider changing the "real_name" option in the exported configuration file:

Code:
-bash-4.2# grep ^real_name testlist.config
real_name = 'Testlist'

If you do not modify the real_name option, you will receive a warning message:

Code:
-bash-4.2# /usr/local/cpanel/3rdparty/mailman/bin/config_list -i testlist.config test2_samsaccount.com
<b>real_name</b> attribute not
            changed!  It must differ from the list's name by case
            only.

With that said, you can ignore the warning and rest assured that your other options were successfully imported. Please let us know if you have any questions.

Best regards