#! /bin/sh
# sendsys - arrange to mail sys file to sender identified in stdin's headers

# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/etc/news/bin/config}
export NEWSCTL NEWSBIN NEWSARTS
PATH=$NEWSCTL/bin:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK

canonhdr >/tmp/ctl$$

SENDER="`newsreply </tmp/ctl$$`"
case "$SENDER" in
newsmap@*)	;;
*!newsmap)	;;
*)	exit 0	;;	# do not reply to non-newsmap addresses
esac

what="`egrep '^Message-ID:' /tmp/ctl$$ | awk '{print $2}'`"
when="`now +1d`"
echo "$when $what" >>$NEWSCTL/delayed

echo "$NEWSCTL/sys file will be sent to $SENDER shortly.
Please remain calm.  DON'T PANIC.  This is perfectly routine.
Your sys file is public information by definition.
This is a requirement of membership in Usenet.
Please don't waste everyone's time by asking about this on Usenet
or by harassing the person who sent the sendsys control message." |
	report 'sendsys queued'
rm -f /tmp/ctl$$
