LISTSERV Tech Tip |
By Jacob Haller
Senior Support Engineer, L-Soft
Sometimes it may be necessary to make the same configuration changes to multiple mailing lists. This can be challenging as LISTSERV doesn't provide a built-in way to make such bulk changes. With that said, there are a few ways you can approach this. The most appropriate method will depend on the number of lists you need to update, how complicated the changes are and what resources are available to you.
There are ways to set up a mailing list so that it pulls some portion of its configuration from another mailing list, or from an external file. I won't discuss those options in this tech tip, but, if you think this may be useful for your setup, you can contact L-Soft support for more information about this.
If this is a one-time (or infrequent) task, then it might be easiest and fastest to just bite the bullet and update the configuration of the mailing lists one at a time. One convenient option is to use the table of mailing lists that is included under "List Management" > "List Dashboard". If the setting or settings you want to update aren't currently displayed in the table, then click on "Customize Report" and drag the relevant settings to and from the "Report Columns" area until you've included the settings that you need to change.
If you aren't updating all of the mailing list, then you may find the filter boxes at the top of each column useful. If you type text into one of these boxes, then a filter will be applied so that only mailing lists with settings that includes that text will be displayed. This may be useful if, for instance, you want to change a particular list owner's email address. Type in the email address you want to change in the filter row under the "Owner" column, and you'll only see the mailing lists for which the email address is an owner.
You can then go down the table of mailing lists and click on the value you want to update, row by row, bringing up a pop-up window that will allow you to change the setting and save your changes without ever leaving the page. If you are changing a list owner address, for example, then every time you make the change, the mailing list will be removed from the table, making it easy to see how many more lists you need to update.
If the list configuration setting that you want to change isn't visible on the "Customize Report" screen, make sure that you are in Expert Mode as some options are only visible in that mode. You can activate Expert Mode by clicking on your email address in the upper right-corner of the web interface, selecting "Edit Profile" and choosing the appropriate option from the "Mode" menu.
List owners will normally be able to update their own list configurations, so instead of you as the site administrator making the changes yourself, you can ask the owners to update their own mailing list configurations, which they can do by going under "List Management" > "List Configuration" using the LISTSERV web interface.
As an administrator, you can contact all non-quiet list owners on the server using the ALL-REQUEST email address.
If the list owner's own email address is changing, and they need to update the configuration to reflect this new address, then the recommended way for them to do this is:
1. Go under "List Management" > "List Configuration" and find the "Owner" setting.
2. Add your new address to "Owner", but leave your old address there as well for now.
3. Log out of the web interface, then log in with your new address. You will have to set a password for the new address, if you haven't already.
4. If you are able to manage your mailing list using your new address, then you can go ahead and remove the old address from the "Owner" setting and make any other changes to the list configuration that are desired.
5. If you run into any problems, and aren't able to access the List Management menu when logged in with your new address, then log back out, log in using your old address and double-check the "Owner" setting to make sure it doesn't contain any typos, etc.
This approach is the riskiest. Careless editing of list configurations using this method can corrupt the files and prevent the lists from working properly. Use extreme care.
An Important Warning: Directly editing the .list files in ~listserv/home/ or listserv\main\ will corrupt them.
They appear to be in plain text but are in a very specific format. The following procedure works around that problem.
The instructions below are written as if you were doing the steps by hand, but the same techniques and commands should work in a script.
1. Get a list of the mailing lists that need to be modified.
2. Stop LISTSERV.
3. Back up the listserv\main\ or ~listserv/home/ folder.
4. Create a place to store the modified .list files, for instance a folder named "tempfiles" in ~listserv/home/ or listserv\main\.
5. Now you can create copies of the lists identified in Step 1 in a format that you can edit directly. Under Windows, you would issue commands like this in listserv\main\:
listview listname > tempfiles\listname.list |
Under Unix, you would issue commands like this in ~listserv/home/:
./listview listname > tempfiles/listname.list |
Under either platform, replace "tempfiles" with the path to the directory you created in Step 4, and "listname" with the name of the actual mailing list.
If you're using LISTSERV for Unix and if the "listview" executable doesn't exist already, you should be able to compile it by issuing a "make listview" command in the "listserv" home directory.
6. Make whatever changes are necessary to the .txt files created in Step 5. Make sure that each line containing a setting starts with an asterisk (*) and that no line is longer than 100 characters long.
7. Copy the modified .list files into listserv\main\ or ~listserv/home/, replacing the .list files that are already there.
8. Restart LISTSERV. Look in the LISTSERV log file and you should see entries like this for each mailing list:
22 Oct 2024 09:57:06 Invalid record format for list NAMEOFLIST. |
If you don't see any errors, then that generally should mean that the changes were successful and the mailing lists are ready to use. On the other hand, if any mailing lists have an error instead of the "List reformatted successfully" note, then you can restore the .list file from the backup you made in Step 2, restart LISTSERV again, and try to determine what went wrong.
LISTSERV has a built-in API called TCPGUI, which can be used to send commands to LISTSERV interactively, and this can be used to retrieve and update the configuration of mailing lists. While this is more complicated than other methods, it has the advantage that commands issued via TCPGUI get an immediate response from LISTSERV, giving feedback if something goes wrong.
Probably the simplest way to issue commands using TCPGUI is via a program called lcmdx. Windows users can get it from https://dropbox.lsoft.us/download/lcmdx-intel.zip and Unix users can find some C code for lcmdx in Section 10.5 of the Advanced Topics Manual. This code is provided "as is", and we can't provide help in compiling or modifying it.
Once you've got lcmdx (or create a script of your own that communicates with LISTSERV via TCPGUI), you can update a mailing list's configuration as follows:
1. Issue the following command to get the mailing list's configuration, replacing "nameoflist" with the actual list name:
get nameoflist (msg nolock header |
2. Adjust the configuration of the mailing list as desired.
3. Store the updated configuration using the X-STL command as described in Section 10.4 of the Advanced Topics Manual.
The X-STL command has a very precise syntax, so I strongly recommend testing any script you create that uses this method on some test mailing lists before using it on production mailing lists.
LISTSERV is a registered trademark licensed to L-Soft international, Inc.
See Guidelines for Proper Usage of the LISTSERV Trademark for more details.
All other trademarks, both marked and unmarked, are the property of their respective owners.