DISTRIBUTE(1)

NAME
distribute - reforward incoming messages to a mailing list

SYNOPSIS
distribute -l list-name -h list-host [ -f senderaddr ] [ -r replytoaddr ] [ -a sequence-label ] [ -I issue-sequence-number-file ] [ -H headerfile ] [ -F footerfile ] [ -m sendmailflags ] [ -Rsde ] [ -L recip-addr-file ] recip-1 recip-2 ...

DESCRIPTION
Distribute takes as its standard input a mail message, modifies the header (and optionally the body) of that message, then invokes sendmail to send the message to the specified recipients. It is primarily useful for those who run large mailing lists.

Distribute modifies the header as follows. Any From_, Sender: Return-Receipt-To:, Errors-To:, Return-Path:, or X-Sequence: header lines are deleted. A new Sender: line is added. The address given on the new Sender: line is of the form sender-addr@list-host (if the -f option is used) or list-name-request@list-host (if no -f option is used. If address already contains '@' sign, sender-addr or list-name-request is used). The sender address in the envelope of the mail message will also be set to the address that appears on the Sender: line.

If the -r option is used, next argument treated as reply-to-address. The address given on the new Reply-To: line is of the form reply-to-address@list-host (if address already contains '@' sign, reply-to-address is used.)

If the -I option is used, next argument is used as a file name for sequence number. The file contains only a single number for X-Sequence: nnnn. If the file does not exist, distribute will create new file, and start sequence from one. If the -a option is used, Additional feature for sequenceing is processed. Next argument is treated as a alias-id. X-Sequence: alias-id nnnn, and Subject header is changed to Subject: (alias-id nnnn) Real Subject. Care of Re: sequence is also taken.

If the -e option is used, Errors-To: line is added as list-name-request@list-host form.

If the -R option is used, Received: lines will be deleted from the header. This can make debugging mailing list problems harder, but can also get messages delivered in the case where the path the message takes as it comes in and goes back out is long enough to trigger the sendmail loop detection ``feature''. All other header fields are passed through unmodified.

If the -L option is used, next argument is used as a file name for the list of recipients. The mail is sent both to the address contained in the file and to the address recip-1, recip-2, ...

Distribute checks to be sure that the parens and angle-brackets are matched on the From:, Cc:, and To: lines. Distribute also makes sure that none of the lines composing those fields are over 128 characters long and that none of those fields are longer than 1024 characters long. This is done to work around bugs in very old versions of sendmail. These errors are of the type that are likely to fill the maintainers mailbox with at least one message per each address on the list, and thus are worth taking special pains to avoid. If such a message is detected, it is sent directly to the list maintainer (rather than to the membership), and flagged as being broken.

The -H and -F options can be used to add new text to the message body before the start of the original message and to add new text to the end of the original message body. This feature can be used to remind people about mailing list conventions, among other things.

The -d option can be used to debug distribute. In debug mode, distribute merely prints the sendmail command it will execute, along with the modified header and body of the message. No mail is sent in debug mode.

The -m option can be used to pass additional flags to sendmail on the command line. This can come in handy if one wants to tell sendmail to queue the message rather than attempt delivery immediately, to tell sendmail to use an alternate queue directory, and so on. Using an alternate queue directory can be a big win if you like to keep your big mailing lists from interfering with normal mail delivery on your system.

The -s option turns on the administrivia filter, which attempts to detect messages that were sent to the list readership rather than to the list maintainers. Such messages include ``please add me'' and ``please delete me'' messages. These messages are flagged and sent to the list maintainer.

To use distribute, set up the aliases for the list as follows:
    my-list: /homewhere/my-list-dist
    my-list-request: myname
and set up /homewhere/my-list-dist file as follows:
    | /somewhere/distribute -l my-list -h my-host other-options -L /somewhere/my-list-recipients-file

SEE ALSO
sendmail(8)

DARPA Internet Request For Comments RFC822

DARPA Internet Request For Comments RFC821

DARPA Internet Request For Comments RFC1211

BUGS
The correctness of the header transformations being performed (or not being performed) is debatable. It is believed that the header transformations do nothing wrong; these transformations could be more correct (particularly in the face of Resent-* lines, which are currently not touched at all, and which in theory have precedence over their un-resent brethren), but it seems that most mailers deal with forwarded mail somewhat differently because the spec is somewhat ambiguous. Someone really should write a RFC about all this.

The line and field length checks in the header used to ensure that the From:, To:, and Cc: fields weren't more than 128 bytes long. The current checks may be too permissive.

AUTHOR
Originally by Andrew Partan, asp@uunet.uu.net. Hacked into its current form (and made a bit more RFC822-ish) by Steve Miller, steve@umiacs.umd.edu. Made still more correct with respect to RFC822 by Dave Balenson, db@tis.com. Sequence facility and some hack by Shin Yoshimura ( shin@nc.u-tokyo.ac.jp ), Yoshitaka Tokugawa ( toku@dit.co.jp ), Shigeya Suzuki ( shigeya@foretune.co.jp ), and Hiroaki Takada ( hiro@is.s.u-tokyo.ac.jp ).