#!/bin/sh -

spool_area=__NNTPOUTDIR__	# Must be a full path

qfile=__TMPDIR__/nntpout$$

cd __LIBDIR__

for spool_dir in `find $spool_area/* -type d -print`
do
	# Find the internet name of this host.
	uucp_hostname=`basename $spool_dir`; export uucp_hostname
	inet_hostname=`$AWK'
$1 == '$uucp_hostname' {
	print $2;
	exit;
}
' < ./nntpmap`

	# Use the uucp name if no other information is provided.
	case X$inet_hostname in
		X)	inet_hostname=$uucp_hostname
		;;
	esac

	cd $spool_dir
	find . -print > $qfile

	if [ -s $qfile ]
	then
		./nntpxmit -z -r $inet_hostname:$qfile
	else
		rm -f $qfile
	fi

done

# $qfile has been removed by nntpxmit.
