			     NNTP SUPPORT
			     ------------

This file describes the NNTP support available in nn .  The
NNTP support was implemented by Rene' Seindal, seindal@diku.dk.


			    PREREQUISITES
			    -------------

First of all, you need read-access to an NNTP-server, and if you want
to post, the server must allow that.

The necessary modules to access a remote NNTP server is an integrated
part of nn, so if you specify to use NNTP, the necessary code is
automatically included.

Even if NNTP is defined you can still read news from a local
news spool by either not having the NNTP server file or setting
it to the local host.

			    CONFIGURATION
			    -------------

To use NNTP in nn, you must edit the relevant parts of config.h:

NNTP
	You enable the use of NNTP by defining the macro NNTP.

NNTP_SERVER
	The name of the NNTP server that NN uses is given
	in the file given by the macro NNTP_SERVER.  If the name is not
	an absolute path name, it is taken to be relative to
	LIB_DIRECTORY.

	The format of the file is compatible with the one used in
	clientlib.c in the nntp-1.5 distribution, i.e., the first
	non-blank line, not starting with '#' is taken to be the name of
	the NNTP-server.  This file MUST be present, and must contain a
	valid host name.

NNTP_POST
	If you use the NNTP based inews (part on the NNTP distribution)
	and you have hosts that are not allowed to post to the NNTP
	server, you should defined this.  It will make nn check at
	connect time whether the NNTP server allows postings, and reject
	all attempts to post, if the server disallows posting.  If you
	do not define this, users will be allowed to post by nn, but the
	posting will eventually fail.

	Again, this parameter is only relevant, if you use the NNTP
	based inews, and have hosts that are not allowed to post.

NNTP_MINI_INEWS_HEADER
	This should not be set if you are using the INEWS that
	comes with NN, but may be required if you are using the
	separate NNTP distribution.

NEWS_LIB_DIRECTORY & INEWS
	If either is defined, they specify the destination of the
	mini-inews program when installed below with INEWS being used
	if both are defined.  If neither is defined, it will be
	installed in /usr/lib/news/inews.

	
		
				TUNING
				------

Both the server and each client maintains a cache of recently accessed
articles, to minimize communication with the server (mainly to avoid
fetching large digests continuously).  The master needs the cache when
it splits digests, and the clients need it, because nn has a tendency to
reopen the articles several times.

NN caches articles since it tends open articles several times. The cache
is kept in the users .nn directory.  The constant NNTPCACHE (defined in
nntp.c but can be redefined in config.h) defines the size of the cache,
whose optimal size depends on the amount of news kept on line on the
NNTP-server.  Values of 5-10 gives reasonable results.  The effect is
most striking when reading digested news.

The location and size of the cache can also be changed on a per-user
basis via the related nntp- variables (see nn.1).


			     INSTALLATION
			     ------------

Making and installing nn using NNTP does not differ from a non-NNTP nn
installation, except for the differences in the configuration and the
need to specify the NNTP server in the NNTP_SERVER file.

				INEWS
				-----

If you want to post news via the NNTP server, you will need to run a
program named `(mini-)inews' if this isn't found by configure the
NN ./inst can be used to install ther version that comes with NN.


As far as I know, NNTP_MINI_INEWS_HEADER needs to be defined in
nn's config.h for nn to work with this mini-inews version.


			       PROBLEMS
			       --------

I am not certain what should happen if the server sends back responses
in the 1xx range.  I do not know whether a NNTP server is allowed to
return one of these responses on its own initiative.  If it is, nn
should probably ignore (or display) the messages.  Currently, nothing is
done to treat these responses in any way.

		      SPONTANEOUS NNTP ERROR 502
		      --------------------------

Sometimes nn  may stop with the following message:

	NNTP 502 You only have permission to transfer, sorry. 

This particular case is probably the result of the NNTP server trying to
turn your IP address into a fully qualified domain name (FQDN) so it can
look you up in its access file.

The NNTP server probably uses the domain name server (DNS) to map IP
addresses into FQDNs.  If the local DNS doesn't already know the answer, it
has to go out over the network to find it.  This can take a few seconds, and
the library routine that does all this for the NNTP server might time out
before the answer gets back to it.  If this happens, the NNTP server doesn't
know your FQDN, so it gives you the default access specified in the server's
nntp_access file, which is usually "xfer" (article transfer only).

In the time it takes for you to run nn again the DNS usuallu has its answer
back, so things usually work the second time.  

One way to work around this problem is to specify the IP address of the
client in the nntp server's access file; then it is not necessary to lookup
the FQDN.

Thanks to Tim Ramsey and Nick Sayer for this information.


		      DEBUGGING NNTP CONNECTIONS
		      --------------------------

In  nn  you can turn on the nntp-debug variable in
the init file.













