mjdispatch

(Handles messages for majordomo under a qmail system)

SYNOPSIS

mjdispatch < message

DESCRIPTION

This script handles incoming mail for a Majordomo system running under qmail. It's designed to deal with mail to listname, listname-request, listname-owner, and listname-approval. The goal is to be able to hand everything over to this script rather than having to maintain innumerable different .qmail alias files for all of your lists (many of which contain identical or programmatically-determinable content).

This script can be run out of .qmail-default with:

    |/var/qmail/majordomo/mjdispatch

It requires list.owner files in the list directory for every list that doesn't have the default owner (specified at the top of this script). Multiple addresses in that file are supported, but only to the allowable command line length supported by your operating system, so don't put a hundred addresses in there.

Messages sent to listname will be passed off to Majordomo's resend program. Messages sent to listname-request will be passed off to the majordomo program itself. Messages sent to listname-owner or to listname-approval will be sent to the addresses listed in the listname.owner file.

Note that to work correctly with virtual domains, this script uses the environment variable DEFAULT to extract the address that a message was sent to. If you're using a version of qmail prior to 1.03, this variable won't be set and this script won't work. You'll need to change DEFAULT to LOCAL and possibly munge LOCAL if you're using virtual domains.

The path to the directory containing your list and list.owner files must be set at the top of this script (it's /var/qmail/majordomo/lists by default).

RETURN VALUE

For temporary errors, such as inability to exec a program, mjdispatch exits 111 to tell qmail to defer the the message and try to deliver it again. If the listname file doesn't exist or if the address isn't of one of the forms mentioned above, it instead exits 100 after printing a message designed to simulate qmail's unknown user bounce.

ENVIRONMENT

DEFAULT

Parsed to find the list name and the function being performed. The list name will be taken to be everything up to the last hyphen, and the function will be taken to be everything after that, unless the content of this variable matches a file name in the list directory (in which case, the whole thing is taken as the list name). This variable will be set by qmail to the portion of the address matching the -default part of the .qmail file name.

FILES

/var/qmail/majordomo/lists

The default mailing list directory (the directory containing the list files and the list.owner files). Edit the top of this script to change it.

/var/qmail/majordomo/majordomo

The default path to the majordomo program. Edit the top of this script to change it.

/var/qmail/majordomo/resend

The default path to Majordomo's resend program. Edit the top of this script to change it.

Note that if set up properly, mjdispatch will already be running as the correct user, and therefore Majordomo's wrapper program won't be necessary.

SEE ALSO

forward(1)

For information about qmail, see <http://cr.yp.to/qmail.html>.

For detailed information on how to install and use this program, see the Majordomo with qmail FAQ at <http://www.eyrie.org/~eagle/faqs/mjqmail.html>.

Current versions of this program are available from its web site at <http://www.eyrie.org/~eagle/software/mjqmail/>.

AUTHOR

Russ Allbery <rra@stanford.edu>

COPYRIGHT AND LICENSE

Copyright 1997, 1998, 1999, 2002 by Russ Allbery <rra@stanford.edu>

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

Last spun 2022-12-12 from POD modified 2002-06-29