Majordomo CGI programs
Introduction
In order to support the mailing lists supported by Majordomo, Peak commission
a pair of programs to support web access to the facilities of Majordomo.
This web based CGI suite allow users to:
- Subscribe to a specified mailing list.
- Unsubscribe from a specified mailing list.
- Get a help message from Majordomo.
- Get information on the specified mailing list.
- Return an index of files you can "get" for the specified list.
- Find out which lists your email address is on for the specified host.
- Find out who is on a specified list.
- Get an index of the mailing lists available on the specified host.
- Get a file from the archive associated with the specified mailing list.
Unlike normal use, this example does not have the mailing list or server filled in.
For the normal case of subscribing to a mailing list, all that people need to do is
to fill in their email address, and hit the Submit button.
The other commands require pushing the appropriate radio button.
These programs can be used from Peak to support your own Majordomo
mailing lists by creating an entry which looks something like:
<a href="http://www.peak.org/cgi-bin/majordomo?MLNAME:SERVERNAME">MLNAME</a>
Replace MLNAME with the name of the mailing list, and SERVERNAME with
the name of the Majordomo host.
This program presents a form which allows access to all of the Majordomo facilities
with some of the fields pre-filled in.
Running the CGI programs on your server
You can get these programs to run on your own server.
I have placed these programs in the public domain, so you are free to do what
you want with them. However, they are offered with no warranty of any kind;
use them at your own risk.
A few more weasel words: It is common knowledge that many web administrators
are nervous when it comes to user written CGI programs. After examining a few,
I have come to appreciate why this is so. Thus, for your own sanity and protection,
trust no CGI program until you (or someone you trust) has examined the CGI
program in question. Now I don't expect that you'll find any problems in these
programs (and I'd appreciate knowing about problems),
but you shouldn't take my word for it.
When you transfer these files, ensure that the end of line characters are appropriate
for the computer you are running the programs on. In particular, if there are
carriage returns on the line using a unix server, Perl will not be able
to start the program correctly.
The form generating program
The first program is called
majordomo.
It presents a form which requests a number of fields to be filled in.
Once the form is complete, it calls the other program to actually process the form.
This first program is a very trivial program. If you don't like it's
appearance it should be trivial to change it.
Note that before using it, you will need to set the path at the
top of the program to where you keep your Perl interpreter, and you
may want to change the name of the $DefaultHost down in the configuration
section.
The form processing program
The second program is called
majordomo2.
It processes the form generated by majordomo.
This second program is not much more fancy then the first.
However, as there is no user interface, there is probably not
much need for modification.
Note that before using it, you will need to set the path at the
top of the program to where you keep your Perl interpreter, and you
may want to change the name of the $DefaultHost down in the configuration
section.
This program works by sending email as if the indicated person
had sent it.
This is done on behalf of the user specified, so there really should be
no harm; it is nothing that cannot be done by talking to the SMTP port.
Majordomo2 can also process the QUERY_STRING. If the URL is followed
by ? and a set of name=value pairs, you can cause the program
to process majordomo requests directly.
The names allowed are:
- email=name@domain
This specifies the user name which is attempting to do something.
- mlist=mailing_list_name
This specifies the name of the mailing list. Don't put a domain
name on this.
- host=domain.name
This is the host which handles the mailing list.
- fname=file.name
Specify the name of a file to retrieve.
- subscribe=1
Specified to subscribe to the mailing list.
- unsubscribe=1
Specified to unsubscribe from the mailing list.
- info=1
Specified to get the information for a specific list.
- index=1
Specified to get the index of available files.
- who=1
Specified to get a list of names on the mailing list.
- get=1
Specified when a file is to be retrieved.
Warnings
This program makes it trivial to subscribe random people up to random
mailing lists. Of course, the majordomo mail server makes it
trivial as well, this just gives a web interface to it. Thus it is
possible for this facility to be abused. So far at Peak we have not
seen a real problem with it. However, it is a possibility. Again,
the email interface is just as susceptible, so this isn't doing anything new.
There is a logfile maintained by majordomo2, and the filename is listed at the
top of that program as $LogFile. If this points to a file that the web server
can write on, then a log of the majordomo requests is maintained.
Note that the permissions that the CGI program runs as is dependant upon
the configuration of the web server, so pay attention to permissions
if you want to activate this. There are no programs to process this log.
Another file, the hotlist file contains patterns
to compare against the site making the request. If the site matches
one of the patterns, the request is ignored. This is to get around
rogue sites.
Archive
You can pick up a
tar archive of this package.
This contains all of the programs and sample files.
If you have any questions on this process, please drop a note to:
Dave Regan