GETNEWS.CMD                                    16 February 2001

Purpose:       To take news from an NNTP news server and feed
                 it into mailing lists, using one mailing list
                 per newsgroup.  Also to feed articles back
                 from the mailing list to the newsgroup.
Author:        Peter Moylan
Last updated:  16 February 2001


OVERVIEW

Normally you would use a newsreader to read NNTP news, but
some people prefer their news to arrive in the form of e-mail.
This script does this by fetching news from one or more
newsgroups on a specified news server, and sending the news
as mail to mailing lists.

For simplicity, the mailing list name is assumed to be the
same as the newsgroup name.  For example, if you are taking
the news from a newsgroup called talk.elephants, then the
mailing list is assumed to be called talk.elephants@hostname,
where the 'hostname' part is the name of the server on
which you are running this software.

If your mailing list processor is Major Major, you can
turn this into a two-way feed - the instructions for doing
that are included in this README.


PREREQUISITES

These scripts are basically the 'glue' that connect several
pre-existing software components.  You have to make sure
that you have the following things before proceeding.

1. Obviously, you need a place to get the news from.  This
   does not have to be a news server on your own machine
   (although that is one possibility).  It can be any
   NNTP server that will allow you to fetch news from it.

2. You will need software that lets you create and operate
   mailing lists, and that in turn means that you need
   access to an e-mail server that allows you to create
   accounts.

   The easiest solution is to get yourself a copy of the
   Weasel mail server and the Major Major mailing list
   software, both available from http://eepjm.newcastle.edu.au/os2/.

   The instructions in this file assume that both Weasel
   and Major Major are running on the machine on which
   you are installing the present software.
   If you have different mail software, or you have
   Weasel running on a different machine, you can still
   in principle use these scripts, but you will almost
   certainly have to make some modifications.

3. You need a way of scheduling this script to run at
   regular intervals, e.g. once per hour.  To get you
   started I have included a simple script called
   schedule.cmd to do the job, but a number of schedulers
   of various kinds are available, so you might
   prefer one of them.


INSTALLATION

1. If you don't have Weasel and Major Major installed, install
   them first.  The most recent versions are at
        http://eepjm.newcastle.edu.au/os2 and at
        ftp://eepjm.newcastle.edu.au/software

2. Go to your Major Major directory, and create a subdirectory
   called 'News'.  Move all the files in this package into
   that directory.

3. Ensure that RXU.DLL is on your LIBPATH.  You might already
   have RXU if you've installed some of the Weasel utilities.
   If not, you can find it at
        ftp://hobbes.nmsu.edu/pub/os2/dev/rexx/rxu1a.zip

4. Edit the file getnews.cfg to specify where Weasel is
   installed, and where the news is coming from.
   See the file CFG.DOC for the format of getnews.cfg.
   That file also says how to specify the newsgroups,
   but you can ignore that part, because it will be
   automated in step 5 below.

5. For each newsgroup that you want to echo, run the
   command

        addgroup groupname

   (for example, "addgroup alt.test".)  This will update the
   configuration file, and also update the Weasel and
   Major Major configurations.

  At this stage you should be able to do a test.  Run
  getnews.cmd and see whether news is fetched and sent to
  the mailing list accounts.  After a successful test, you
  will probably want to edit getnews.cfg again to reset the
  article numbers to zero; otherwise, the articles you have
  already fetched will not be fetched again when you put
  the system into production.

6. Once everything is working, use your preferred scheduler
   to ensure that getnews.cmd will be called at regular
   intervals.  If you have no preferred scheduler, use the
   script schedule.cmd that is included in this package.


THE FUNCTION OF THE SCRIPTS INCLUDED IN THIS PACKAGE

1. The script getnews.cmd is the main component; it is the
   one that talks to the news server, sending and fetching
   the news.  You should run it regularly.

2. The script schedule.cmd has as its only function the
   regular running of getnews.cmd.  This is optional; if
   you have another scheduler (e.g. cron) then you don't
   need schedule.cmd.

3. The script addgroup.cmd adds a newsgroup to the list of
   newsgroups you are echoing.  It updates the configuration
   file, and more importantly it creates the appropriate
   Major Major and Weasel accounts, saving you the trouble
   of having to go and update the configuration of those
   two programs separately.

4. The script rmgroup.cmd is the opposite of addgroup.cmd;
   it deletes the mail and mailing list entries for the
   specified group.

5. The script feedtonews.cmd is a filter to be used with
   Major Major.  (The addgroup.cmd script automatically
   installs this filter.)  This is how mail sent to the
   newsgroup is sent back to the news server.

