
				N e w j u n k
				-------------

		Install new newsgroups by scanning the junk directory.

Written 2/91 by Michael A. Meiszl (mam@hamm.sub.org)

If your systems receives news from more than one feed or from more than one
net, you sometimes notice your junk directory growing pretty fast. This is
mostly due missing control messages from the nets. You can configure your
news software to install a new group automatically on reception of a newgroup
control message, but you can't do anything against a feed that decides to
send you more groups without notice.

So its up to the system operator to check junk concorrently and to decide 
whether he needs to install that new group by hand or whether it was only
a crossposting from another net.

Managing more than ones systems doubles the work of the operator and if this
happens quite every day (we got big feeds here :-(), it was time for a cute
little program that does the work for me...

Newjunk is a straightforward program which only reads through the junk direc-
tory and scans for the "Newsgroups:" line in the message header. It exctracts
the wanted newsgroup(s) and checks against the active file. Since it only
reads the first field of the active file it will work with B- and C-news
without modifications. If the group is already there, nothing is done with it.
This keeps track of the chance when B-news will eject an valid article because
it is "too old".
If the group is not installed, newjunks checks if the group leader is already
there. If not, the message is considered as a crossposting from another net
and the message is thrown away. If the net is there and the group is new,
newjunk creates an call to inews gererating an newgroup control message for
a given distribution. Normally you set this distribution to "local", so only
your system will be affected, but for managing more systems it is well suited
to create an own distribution, so newjunk must only be run on the main machine.
After newjunk is done it can start a normal script file which is executed by
/bin/sh. Look at my sample newjunk.sh for some ideas what you can get from it.
The tasks done by the script could easily be placed in the program itself,
but a script is easier to adopt than fiddling with the code.

INSTALLATION:
Edit the Makefile newjunk.h  and newjunks.sh for your needs then type "make".
You can edit the message in newjunk.msg too, but please leave the copyright
statement in it.
This should build the executable in the local directory. You can test your 
nstallation by calling "newjunk -t" which will do all scanning but no executing.
It will inform you about unreachable files or directorys and scan your junkdir.
If everything looks good, type "make install". This will copy newjunk and 
newjunk.sh into the news lib/bin directory and set permissions that it can
be executed by the owner of the news system (normally "news").
Now su to the news user and edit its crontab entry. Add a line for newjunk.
Running newjunk once a week or once a day depends on your traffic. Make
sure its run before your junk expires!
Your'e done and hopefully are rid of some work too...

COPYING:
The program is put into the public domain, it may be copied and modificated
without notice as long as the original author's name is included. The
program may not be sold in any way. Especially semi-commercial "public-
domain-resellers" are discouraged to keep and sell this program. Mailboxes
can distribute it as long as they take no fee from there users.
If major modifications are made, please send me the diffs.

BUGREPORTS:
	Send diffs an bugreports to:	
		mam@mamnix.hamm.sub.org or mam@mamnix.garmhausen.de
		Michael A. Meiszl
		Tomsonstrasse 25
		D-W4700 Hamm 1
		Germany 	(the "West" is obsolete nowadays :-))
