Managing Majordomo

The most difficult part of mailing lists is day to day management. If you do not have good documentation, good communication with your owners and list members, and good tools, lists can quickly become an enormous time sync. It is very important to hand-off tasks to the lowest link in the mail chain at every opportunity so: 

root	-->	listmaster	
listmaster	-->	listowner	
listowner	-->	list members	

If you're the listmaster, you'll also want a set of tools that allow you to deal with routine tasks (list creation/deletion/etc.) and problems with a minimum of effort. 

Lets set a few x-windows for a working environment: 

# xterm -sb -sl 2400 -title Root_Account
# xterm -sb -sl 2400 -title Majordom_Account
# xterm -sb -sl 2400 -title Majordom_Mail

su down to the majordom account in the two Majordom windows: 

# su majordom

You can kill any unneeded windows by holding down the control key and clicking the left mouse button - then scroll down to quit. If you want to save your exiting windows, minimize them to free up screen space. 

Copy the md-apps.tar.gz file that we picked up earlier via ftp from /u/work to the /home/majordom directory and unpack the files:

-- In the Majordom_Account Window

$ cp md-apps.tar.gz /home/majordom/.
$ cd /home/majordom
$ gzip -d md-apps.tar.gz
$ tar -xvf md-apps.tar  
$ cd applications

This will create a sub-directory called applications which includes a number of perl scripts and some web interface related files (*.html & *.cgi). You will find a short menu of these files in applications/README.MD-APPS.
 
Description of the md-apps Scripts 

This set of scripts & web files does the following:

•	Allows users who want to create a new list or digest to request such a list by filling out a web based form. (new-app.html & newapply.cgi)

•	Sends the user request to the majordom account for listmaster processing. The list will not be created until the listmaster pipes the request to the mklist script (we'll do this from pine).

•	Creates basic list files (listname, listname.info, listname.config & listname.passwd) and sends back a mail message containing the entries needed in majordomo.aliases.

•	At this point the listmaster edits the majordomo.aliases file by hand to enter the list aliases and then runs exim_dbmbuild or newaliases.

•	Completes the process of activating the list, enters the list information in a local web page and sends mail to the requester or listowner (listlist script).

There are additional web resources and scripts to create a digest for an existing list and to allow an owner to request the deletion of a list as well as a number of small tools that aid in dealing with common problems. 

A practical exercise
Using the sample set of perl scripts that help streamline list creation described above.

This set of scripts were developed at the University of Oregon by a former listmaster (Rich Haller) to allow users to submit a list request via the web and have the process of list creation semi-automated. 

The process takes several steps - and some of the conditions here are particular to the way lists are managed at UO - but this will give you an idea of how easy it is to customize your majordomo management tasks using perl. 

Before we can request a list and process the input, we need to modify some values in the applications files and we'll need to move the web files to a public_html directory. I've provided a dummy host name (machine.host.tld) which occurs in many of the files 

$ grep machine.host *

You'll want to change all of these - and we'll use a quick perl one-liner to do this in the root window: (replace the _ with your machine number) 

$ perl -i.bak -p -e 's#machine\.host\.tld#t1-user_\.t1\.ws\.afnog\.org#g' *

This one-liner runs at the command line and it will create a back up copy of all the files.

Delete all the backup files created during the text substitution in the command above.

$ rm *.bak

If you run grep again, you shouldn't find any files that contain machine.host.tld but you should see a long list that contain t1-user. Now - make majordom the owner and allow majordom to execute the files.

# chown majordom:majordom *
# chmod u+x *

The perl script $HOME/applications/listlists requires the following directories to be created:

# mkdir /home/majordom/public_html
# mkdir /home/majordom/public_html/cgi-bin
# chmod a+rx /home/majordom/public_html
# chmod a+rx /home/majordom/public_html/cgi-bin
# mkdir /home/majordomo/applications/done

Move the html and cgi files as needed: 

# mv *.html ../public_html/.
# mv *.cgi ../public_html/cgi-bin/.
# mv mdaps_subs.pl ../public_html/cgi-bin/ 
# chmod a+x /home/majordom/public_html/cgi-bin/*

Before your first use the following lines in listslists can be updated to include host info: 

print LISTS "<TITLE>Lists Served from majordomo\@tesla.uoregon.edu"; 
print LISTS "<h2>Lists Served from majordomo\@tesla.uoregon.edu</h2></center>\n"; 
print LISTS "to majordomo\@tesla.uoregon.edu<p>\n";

Now we'll start the apache web server and try out the scripts: 

# /usr/local/sbin/apachectl start
# lynx http://t1-user_.t1.ws.afnog.org/~majordom/newap.html

Ready to request a new list!

First, generate the users list request: 

•	The form – newap.html
•	the cgi script – newapply.cgi
•	The listmaster email  

The List Request Process

1.	Fill out the form and submit.
2.	Use a set of perl scripts to create the basic list files.
3.	Open pine as majordom and pipe the email message to the mklist perl script using Pine:(| /home/majordom/applications/mklist)
 
NOTE: If pine is not configured to allow pipes, 
•	go the main menu, 
•	select set-up -> configure -> scroll down to [ ]enable pipe commands and put an “x” inside the brackets 
•	exit and save your settings. 

This process should result in a second email to listmaster and the creation of 4 files in the lists directory: 

-rw-rw----   1 majordom majordom     1366 Sep 16 13:32 test-list.config
-rw-rw-r--   1 majordom majordom      467 Sep 16 13:32 test-list.info
-rw-rw----   1 majordom majordom        6 Sep 16 13:32 test-list.passwd
-rw-rw-r--   1 majordom majordom       62 Sep 16 13:32 test-list.pending

4.	Activate the list by doing the ff.:

•	Edit majordomo.aliases and add the entries found in the above email 
•	Run exim_dbmbuild or newaliases depending on which MTA you are using.
•	Run /applications/listlists to move listname.pending to listname which will activate the list, and email the new owner informing him that the list is ready to go! 

Quick review: 

Why you might want manual intervention
Day-to-day utilities (standard tasks)
Trouble shooting & standard problems
Manage your List Owners - not their lists
List owner list (listowners script)
Small Tools (Unique a list, etc...)

Other administrative resources 

Majordomo Workers List Archives (searchable)
http://www.hpc.uh.edu/majordomo-workers/ 

Subscribe to the list by sending email to:
majordomo-workers-request@greatcircle.com 
using the command: subscribe majordomo-workers