#!/bin/bash

# where maillists will be stored by procmail
# file names must be indentical to your newsgroups 
# like that : <news_prefix>.file name must be equal 
# to newsgroup name
TOGO=/home/maillist/togo
# where the sendlist binary 
BIN=/home/maillist/newslist-0.02/sendlist.pl
# where the config file 
CONFIG=/home/maillist/config

cd $TOGO
for i in *
do 
	if test -f $i
	then
		echo Running throught new messages for $i
		mv $i $i.sending
		sleep 1;
		cat $i.sending | $BIN -c $CONFIG -l $i -d 2
		rm $i.sending
	fi
done
