#!/bin/sh
#
# sllsub
#
# This is a sample batch file to call your mail program.  You will
# need to modify this to work properly with your mail system, or the
# subscribe feature of sll will not work.  For this example, it is
# assumed that sendmail is installed in /usr/lib and will, with the -t
# switch, read the "To:" line in the header of the message to determine
# who to send the mail to.
#
# The following parameters are expected:
# $1 is the address to which the subscription request is to be sent
# $2 is the official name of the list
# $3 is the name of the person placing the subscription
# $4 (BZS) and the sender's e-mail address
#
# The idea is to send mail to the subscription address with the
# subject line reading "SUB list-name user-name" and the same thing
# in the body of the message.  In most cases, the subscription will
# work if either the subject line or the body contains the subscription
# request, but we put it in both places in this example.

TMP=/tmp/SLL.$$

trap finish 0 1 2 3 15

finish() {
	rm $TMP
	exit 0
}

echo From: $4 > $TMP
echo To: $1 >> $TMP
echo Subject: SUB $2 $3 >> $TMP
echo  >> $TMP
echo SUB $2 $3 >> $TMP
cat $TMP | /usr/lib/sendmail -t
