When mail (a subscription, unsubscription, or an article intended for a moderated list) needs approval, majordomo sends the message to the list owner(s). Any list owner (and in fact, anyone who knows the list password) can send an approval message back to Majordomo to approve the request.
A "list owner" is the person (or people) listed on the "listname-approval" alias in your system aliases file. (For sendmail, that filename is usually /usr/lib/aliases or /etc/aliases.)
Note that Majordomo lets you put different people on the "listname-approval" and "listname-owner" aliases. If you split those duties between two different people, keep that in mind as you read the sections below. I've assumed that all list messages needing action go to a single "list owner."
The list owner doesn't even need to be on a UNIX system, although majordomo comes with some UNIX scripts that make life easier for the list owner.
Majordomo Commands for List Owners
The requests for users can also be used by list owners. But there are three
more password-protected commands just for list owners. These aren't mentioned in
Majordomo's help file. If the owner doesn't have an account on the machine where
Majordomo runs, these commands allow routine housekeeping via e-mail:
Subscribe or unsubscribe someone from the list "list". For example:
approve !BooM! subscribe donut-makers Bob Bakerapprove !BooM! unsubscribe donut-makers john.dough@bakers.org
Change the subscription approval password for "list" from "old-password" to "new-password". Remember that this password is stored, unencrypted, on the computer running Majordomo. Don't use your login password!
Change the text in the "listname.info" file (the text a user receives when they mail an "info" command or subscribe to the list). The text is taken from the rest of the mail message until a line with the three upper-case letters "EOF" at the start.
E-mails a copy of the configuration file for "list" to the owner. The owner can edit the configuration file and send it back with "newconfig".
newconfig list password
...config file contents here...
EOF
The "newconfig" command installs a new configuration file for
"list". After you type the "newconfig" command, the rest
of the mail message should be a copy of the new configuration file.
Rewrites the configuration file into standard form--including all documentation in the configuration file.
Force a digest to be generated for "list".
"approve" can be run either on the machine where majordomo is running or on a remote machine where the list owner is managing the list by e-mail. The "approve" script assumes that the Perl interpreter is in /usr/local/bin/perl. If Perl is somewhere else, the first line of the "approve" script should be edited to the path for that system:
#! /usr/local/bin/perl"approve" uses a file named ".majordomo" (the name starts with a dot) in the owner's home directory. It has an entry for each of the owner's lists: the list name, list password and e-mail address of its Majordomo server. There's a tab character (NOT space characters) between the three fields in each line. For example, this is the ".majordomo" file for the owner of the "donut-makers" and "mud-wrestlers" mailing lists:
donut-makers !BooM! majordomo@bakers.org mud-wrestlers GoJoan majordomo@foo.bar.comFor security, it's a good idea to protect the file from other users. Use a command like "chmod 600 .majordomo".
To approve a request, feed the original approval-request message from Majordomo to the "approve" script. Messages can be saved in separate files, one per message, and named on the command line:
% approve file1 file2 etc.Messages can also be fed to the standard input of "approve". For example, in MH mail, where the "show" command displays a message:
% scan 32
32+ 09/05 Majordomo@bakers.o APPROVE donut-makers<<-- postmaster@yu
% show | approve
Or in "mush", the Mail User's Shell:
...
> 32 Majordomo@bakers.org Sep 5, (29/804) "APPROVE donut-makers"
...
Msg 32 of 78: pipe approve
The command in the Berkeley "mail" program is simply a vertical bar
(|). (For other mailers, check your documentation or help screen.)
Approving Subscriptions without "approve"
It's possible that a list owner may be using a PC or some other system where
the "approve" script won't work. In that case, everything that
"approve" does can be done manually. This section and the next may
also be useful for those who want to know what "approve" does in more
detail.
If someone sends a non-routine subscription to "majordomo", the server sends a message to the list owner. There are two kinds of non-routine subscription. One is when the person sends a subscribe/unsubscribe command with a different e-mail address than their own. The other is if the list is "closed"--that is, when the owner must approve all new subscriptions.
For example, the system postmaster at a bakery might want to set up a list exploder (see Chapter 2) for the "donut-makers" mailing list. She adds an exploder named donut-makers-dist@yummybake.com and sends this mail to the Majordomo server:
From: postmaster@yummybake.com To: majordomo@bakers.org subscribe donut-makers donut-makers-dist@yummybake.comWhen Majordomo gets the message, it sees that the subscription address isn't the same as the sender's address. So it sends the following mail message to the list owner:
From Owner-Majordomo@bakers.org Sun Sep 5 08:56:09 1993
To: donut-makers-approval
From: Majordomo@bakers.org
Subject: APPROVE donut-makers
Reply-To: Majordomo@bakers.org
--
postmaster@yummybake.com requests that you approve the following:
subscribe donut-makers donut-makers-dist@yummybake.com
If you approve, please send a message such as the following back to
Majordomo@bakers.org (with the appropriate PASSWORD filled in, of course):
approve PASSWORD subscribe donut-makers donut-makers-dist@yummybake.com
If you disapprove, do nothing. Thanks!
Majordomo@bakers.org
If an owner doesn't want to apprive the subscription request, I suggest that he
not just "do nothing." If a subscription is rejected, it's a good idea
to reply and explain why. Otherwise, the subscriber will probably write to ask
because she already got a message like this:
From Owner-Majordomo@bakers.org Sun Sep 5 08:56:09 1993
To: postmaster@yummybake.com
From: Majordomo@bakers.org
Subject: Majordomo results
Reply-To: Majordomo@bakers.org
--
>>>> subscribe donut-makers donut-makers-dist@yummybake.com
Your request to Majordomo@bakers.org:
subscribe donut-makers donut-makers-dist@yummybake.com
has been forwarded to the owner of the "donut-makers" list for approval.
This could be for any of several reasons:
You might have asked to subscribe to a "closed" list, where all new
additions must be approved by the list owner.
You might have asked to subscribe or unsubscribe an address other than
the one that appears in the headers of your mail message.
When the list owner approves your request, you will be notified.
If you have any questions about the policy of the list owner, please
contact "sample-approval@bakers.org". Thanks!
Majordomo@bakers.org
As the message to the list owner explained, the owner can approve the
subscription by mailing an "approve" command to the majordomo server:
From: owner-name@owner-address To: Majordomo@bakers.org approve !BooM! subscribe donut-makers donut-makers-dist@yummybake.com(where "!BooM!" is the list password).
Moderating Lists without approve
This section describes how to moderate messages manually if you can't use
"approve". It also shows the messages that get passed between the list
owner and Majordomo.
Here's a message that the "donut-makers" list owner just received:
Date: Sun, 5 Sep 93 22:17:34 PDT To: Donut-makers-Owner@bakers.org From: Donut-makers-Owner@bakers.org Subject: BOUNCE Donut-makers@bakers.org: Approval required >From elliek@hearthbake.com Sun Sep 5 22:17:29 1993 Date: Sun, 5 Sep 93 22:17:29 PDT From: elliek@hearthbake.com (Ellie Katella) To: donut-makers@bakers.org Subject: jelly donuts What's your favorite recipe for jelly donuts? Thanks.If the owner doesn't want to approve the message, it's courteous to mail a note to the original sender and explain why. (Maybe Ellie should read the "donut-makers" "Frequently-Asked Questions" list.)
There are a few ways to tell Majordomo (actually, the "resend" script) to send an approved message. The easiest is the "approve" script. Otherwise, the owner should send mail to the list address (in this case, to Donut-makers@bakers.org). The owner adds a line like this to the approved message header--or on the line before the approved message:
Approved: passwordThere are two ways to do that:
Approved: BigSecret
From: elliek@hearthbake.com (Ellie Katella)
To: donut-makers@bakers.org
Subject: jelly donuts
What's your favorite recipe for jelly donuts? Thanks.
When the "Approved:" header appears with the message headers,
these message headers will be used when the message is sent to the list.
Compare that to the second method below.
For example, in the Berkeley "mail" command:
...
N 17 Donut-makers-Owner Sun Sep 5 22:17 23/733 BOUNCE Donut-makers
...
& mail donut-makers@bakers.com
Subject:
Approved: BigSecret
~f 17
Interpolating: 17
(continue)
~v ...editor starts... edit the headers...
(continue)
~p ...shows message you've edited...
-------
Message contains:
To: donut-makers@bakers.org
Approved: BigSecret
Date: Sun, 5 Sep 93 22:17:29 PDT
From: elliek@hearthbake.com (Ellie Katella)
To: donut-makers@bakers.org
Subject: jelly donuts
What's your favorite recipe for jelly donuts? Thanks.
(continue)
^D ...sends message...
&
In this second method, the message sent to the list will contain the headers
below the "Approved:" line. Headers above the
"Approved:" won't be used.
Either way, Ellie's message will go to the list with no trace of the password:
From Donut-makers-Owner@bakers.org Sun Sep 5 23:40:22 1993 Date: Sun, 5 Sep 93 22:17:29 PDT From: elliek@hearthbake.com (Ellie Katella) To: donut-makers@bakers.org Subject: jelly donuts Sender: Donut-makers-Owner@bakers.org Precedence: bulk What's your favorite recipe for jelly donuts? Thanks.
Return-Path:If your lists will be busy, you'll probably want to set up a special list named "bounces". It's a list for subscribers of other lists whose mail starts bouncing. The address of the subscriber is removed from the list they used to belong to and added to the "bounces" list. A cron job runs the "bounce-remind" script every night to send mail to all the people with bad addresses. The mail's "From:" address and envelope sender are set to "nobody", a user on your system whose mail goes to /dev/null. (The /dev/null file is actually a "black hole." Text written there disappears; it's thrown away.)Date: Sun, 10 Oct 93 13:24:11 EDT From: MAILER-DAEMON@mukluk.ice.ca (Mail Delivery Subsystem) Subject: Returned mail: Cannot send message for 3 days Message-Id: <9310101724.AA20948@mukluk.ice.ca> To: listown@online.ora.com ----- Transcript of session follows ----- 421 tuna.ice.ca: Host tuna.ice.ca is down ----- Unsent message follows ----- Received: from online.ora.com by mukluk.ice.ca (4.1/4.7) id for shh@tuna.ice.ca; Thu, 7 Oct 93 13:05:22 EDT Received: by online.ora.com (5.65c/Spike-2.1) id AA13466; Thu, 7 Oct 1993 10:13:03 -0400 Date: Thu, 7 Oct 1993 10:13:03 -0400 ...
If the mail gets through to a subscriber, the subscriber will find out what has happened and how to fix it. If the problem isn't fixed after a while (usually, a month or so), the list owner can review the "bounces" subscriber list and remove the hopeless cases.
To set up the "bounces" list:
nobody: /dev/nullIf your system doesn't have that user and can't create it, you can get by. Make a mail alias that has an obvious name ("trashcan", "dustbin", "nothing", etc.) pointing to /dev/null; use it in the setup below.
bounces: "|/usr/local/majordomo/wrapper resend -p junk
-l Bounces -f nobody -h foo.com.au -s bounces-outgoing"
The priority "junk" helps stop mail bounces.
Bounced messages come in so many different formats that it's hard to completely automate subscriptions to the "bounces" list. (In fact, in some cases, the addressee of the bounced mail won't even be shown in the message!) If the list owner's system can run a Perl script, the "bounces" script makes the job easy. The script works differently than "approve". The script doesn't read a message from a file or standard input. Instead, it reads its command line arguments:
% bounce listname user@xyz.comThat command would unsubscribe the address user@xyz.com from the "listname" list and add them to the "bounces" list. An owner who can't run the "bounce" script can send mail to Majordomo with two commands like these:
approve passwdA unsubscribe listname user@xyz.com approve passwdB subscribe bounces user@xyz.com (931005 listname)The first command unsubscribes the user from the current list. The second one subscribes the user to the "bounces" list, with a comment that shows the date and the name of the list they used to belong to.
When Majordomo is busy (such as after you've added a new list), you may want to run "tail -f" to watch messages as they're being added to the log. Clean it out periodically. I've found it useful to keep compressed copies of old log files for reference.
The log file won't give you much help with security problems. (As Brent has made clear, security wasn't one of Majordomo's main goals.) Transactions are logged with the "Reply-to:" or "From:" address in the mail message header. For example, you can send a message like this:
Reply-to: John DoeThis is what will be logged (and it will be "FAILED" only if the old password was incorrect):From: Your-real-name To: majordomo@bakers.org passwd donut-makers oldpassword newpassword
Sep 05 21:06:31 bakers majordomo[27604] {johndoe@nowhere.org}
FAILED passwd donut-makers OLD NEW
There's no trace of the original sender or any way to see the "OLD"
password he tried. One way to track messages like these is by reading your
system MTA log file. Another is by making duplicates of all mail sent to "majordomo".
For instance, the following alias would send a copy of all majordomo requests to
"owner-majordomo":
majordomo: owner-majordomo, "|/usr/local/majordomo/wrapper majordomo"Of course, on a busy system, the person who is "owner-majordomo" will get a lot of mail; a mail filter program like "procmail" can store that mail and help to sort out the messages you might really want to see. (You can get "procmail", by Stephen R. van den Berg, from many anonymous FTP sites.) Instead of a mailbox address, you can also give the absolute pathname of a log file. Note that, in many cases, the file will need to be world-writable (mode 622 or 666).
Managing the Archives
An archive is a file containing messages that previously appeared on the
mailing list. You can create an archive simply by putting an entry in the system
MTA alias file as described in the section "Creating a New List".
A list's archive will keep growing forever until you truncate or split it. It's a good idea to split the file once in a while. Otherwise, people who "get" it can receive a HUGE mail message. (Worse, some mailer may truncate the file or refuse to send it.)
Majordomo doesn't come with fancy archive management tools. The Majordomo distribution comes with a Perl script named "split_archive.pl"--it's in the "Tools" subdirectory. It splits an archive file into separate files, one per message, named 0001, 0002, and so on.
You can also put any ASCII file in the archive, and set up a directory hierarchy. But you need to do this by hand. For example, if you want majordomo to mail files that contain non-text characters, you'll need to pre-process the files with a utility like "uuencode" or "btoa".
If your site has an anonymous FTP area, you can set Majordomo to store your archives there. You can also configure the majordomo.cf file to handle "get" commands by mailing requests to an ftpmail server. (See the section "Installing Majordomo".) To do that, define the variables $ftpmail_address (and, optionally $ftpmail_location--the default is the local host) in the majordomo.cf file. The ftpmail setup assumes that the FTP archive is structured the same way as your local archive directory. It uses the pathname $filedir/listname$filedir_suffix for the archive directory, then issues an FTP "get" command for the file specified.
Disabling Majordomo Temporarily
Once Majordomo is running on your system, how do you do maintenance? It's
always active because mail aliases will start the program anytime. If you make a
mistake in your maintenance, mail can start to bounce. One way is to shut off
your system's sendmail daemon, but that affects all mail on your system.
An easier way is to make a small "stub" shell script named "majordomo.hold":
#! /bin/sh exit 75Make that file executable with "chmod 755 majordomo.hold". Then quickly (so there's less chance of causing incoming mail to bounce) swap the "majordomo" Perl script and your "majordomo.hold" script:
% mv majordomo majordomo.tmp && mv majordomo.hold majordomo(The shell's "&&" operator lets you type both command lines before executing either of them. It does the second "mv" command only if the first one succeeds.) When mail comes in, sendmail will run your little script, which will return an exit status of 75. This special status makes sendmail defer (queue) the incoming message and try to deliver it to "majordomo:" again later. When you're done with your maintenance, swap the script with the real "majordomo" script and mail will be processed again. (Special exit statuses like 75 are listed in the file /usr/include/sysexits.h.)
The same thing works with "resend"; disabling it will disable all of the lists.
Note that your sendmail may convert pathnames of commands run by deferred messages to all lower-case letters. This problem may only bite you after you defer messages. For example, if your "resend" alias starts like this:
sample: "|/usr/local/majordomo/wrapper resend
-A -a /usr/local/majordomo/lists/Sample.passwd
The "L" and "S" in that pathname may be changed to
"l" and "s" when the message is deferred. If they are,
"resend" won't be able to find the password file. The fix for this
problem is to either change your sendmail.cf file or make all your file and
directory names with only lower-case letters.