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

# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/etc/news/bin/config}

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 "Your news version number will be sent to $SENDER shortly.
Please remain calm.  DON'T PANIC.  This is perfectly routine.
Your version number 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 version control message." |
	report 'version queued'
rm -f /tmp/ctl$$
