#!/bin/sh
# /var/spool/news/out.going/demon/viamail2news: the demon "batch sender"
# Copyright 1995 John A. Phillips - john@linux.demon.co.uk
#
# This is not a traditional news batch sender.  It expects the pipeline to 
# send it a list of items in the newsbase (a file name and its size, one 
# article per line), instead of a (possibly compressed) batch of the articles 
# themselves.  This can be done by using the C News nocomp script both as the 
# batch builder and the batch muncher in the batchparms file.  This script 
# just mails each of the named articles individually to a mail2news gateway.
#
# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/var/lib/news/bin/config}

while read article size
do
    /usr/lib/sendmail mail2news@news.demon.co.uk < ${NEWSARTS}/$article
done
exit 0
