id=`expr $$ % 1000`
host=`cat /etc/uucpname`
sender=`whoami`
#
spool=/usr/spool/uucp
remote='remote'		# change to suit
dfile=D.${host}$id
tmp=$spool/$dfile
xfile=D.${host}X$id
rxfile=X.$host$id
#
if test -t 0 ; then
	echo -n "Subject: "; read subj
fi
echo "From: ${sender}@${host}.UUCP" > $tmp
echo "Date: `date`" >> $tmp
echo "To: $*" >> $tmp
if test "X" != "X$subj"; then
	echo "Subject: $subj" >> $tmp
fi
echo >> $tmp
cat >> $tmp
if test -t 0 ; then
	echo "EOF"
fi
cat << --EOF-- > $spool/C.$remote$id
S $dfile $dfile $sender - $dfile 0666
S $xfile $rxfile $sender - $xfile 0666
--EOF--
cat << --EOF2-- > $spool/$xfile
U $sender $host
R $sender
F $dfile
I $dfile
C rmail $*
--EOF2--
exit 0
