leafnode(8)

NAME
leafnode - NNTP server for small (dialup) sites

SYNOPSIS
leafnode

DESCRIPTION
Leafnode is a USENET package intended for small sites, where there are few users and little disk space, but where a large number of groups is desired.

The design of leafnode is intended to self-repair after problems, and to require no manual maintenance.

The leafnode program itself is the NNTP server. It is run from /etc/inetd.conf when someone wants to read news. The other parts of the package, fetch and texpire, are responsible for fetching new news from another server, and for deleting old news.

ACCESS CONTROL
No authentication or access control is supported. This is a deliberate omission: Implementing this is a job which should not be redone for each and every service.

I recommend that either firewalling or tcpd be used for access control.

FILES
All these files and directories must be writable by user "news".

/usr/lib/leafnode/groupinfo contains the information about each USENET group. In case of harm, it is rebuilt by fetch(8).

/usr/lib/leafnode/config contains the configuration parameters for leafnode. See CONFIGURATION below.

/var/spool/news contains the news articles; e.g. /var/spool/news/alt/fan/agulbra contains the articles in the alt.fan.agulbra group. Each directory contains articles in numbered files (decimal numbers, monotonically increasing), and a special file called .overview which contains the "Subject", "From", "Date", "Message-ID", "References", "Bytes" and "Lines" headers for each article in the group.

Several subdirectories are special:

/var/spool/news/out.going contains local postings that fetch(8) is to pass to the upstream NNTP server.

/var/spool/news/failed.postings contains local postings that the upstream server rejected. fetch(8) will create files in this directory, but none of the leafnode programs will delete anything in it.

/var/spool/news/message.id contains hard links to each message; this is used in place of the dbz database typically used by bigger servers. (A directory such as this is probably more efficient for the small servers leafnode is designed for but scales very badly.)

/var/spool/news/interesting.groups contains one 0-byte file for each group an NNTP client has asked to read. leafnode will touch the the relevant file when a LISTGROUP, XOVER, XHDR, STAT, HEAD, BODY or ARTICLE command is issued immediately after a GROUP command is issued, and fetch(8) will retrieve all new articles in all groups whose files have been either

    - touched during the past two days, or

    - touched more than once, and at least once within the past week.

/etc/inetd.conf contains the line which starts leafnode. It is strongly recommended to start leafnode as user news.

CONFIGURATION
All configuration is done using the file /usr/lib/leafnode/config. There is no GUI configuration tool yet.

The file is in the common UNIX format: One line per argument, white space allowed, # starts a comment which lasts until the end of the line. Here is a simple example:

# Server is news.somewhere.org
server = news.somewhere.org
# We keep news for 21 days
expire = 21

Since the configuration is so simple, here is another simple example. But different:

server=news02.bigprovider.com
expire=7#don't use much space
maxfetch=1000#again, don't use much space

"server" is used by fetch(8) to select what NNTP server to retrieve news from. Changing this involves a lot of work on part of leafnode and inconvenience for the users. It should not be done without good reason.

"expire" is the number of days a thread should be kept around. This many days after it has last been read, a discussion thread will be deleted by texpire(8).

"maxfetch" specifies the maximum number of articles fetch(8) should fetch from the upstream server in each group. This limits the size of the backlog a reader of a group will see when first subscribing. By default there is no limit, so a new reader will see all of the available postings.

Warning: If you set maxcount too low, regular readers of a group may not see all of the traffic in that group. I recommend setting it to at least 1000-1500.

PROTOCOL
Here are the NNTP commands supported by this server.

ARTICLE
    Return the headers and body text of an article. Leafnode supports this imperfectly; the message-id and article number of the article may not be reported in the reply line. This does not affect any tested NNTP clients.

BODY
    Return the body text of an article. See ARTICLE.

GROUP
    Sets the current USENET group and article pointer, and returns the status information about this group.

HEAD
    Return the headers of an article. See ARTICLE.

HELP
    Accepted but I'm afraid it is not very helpful.

IHAVE
    Known but rejected. See fetch(8).

LAST
    Moves the article pointer back by 1.

LIST
    Lists the available USENET groups.

LISTGROUP
    Lists the articles present in the current group, or the argument group if an argument is present.

MODE
    Accepted and blithely ignored.

NEWGROUPS
    Accepted but the reply is always empty. This command does not make sense for this server.

NEWNEWS
    Accepted but the reply is always empty. This command does not make sense for this server.

NEXT
    Moves the article pointer forward by 1.

POST
    Post a new article. Only scant syntax checking is performed. The article is sent to the upstream NNTP server by fetch(8).

QUIT
    Quit reading news.

SLAVE
    Accepted but ignored.

STAT
    Return the availability of an article. See ARTICLE.

XHDR
    Accepted, but supported only for the "Subject", "From", "Date", "Message-ID", "References", "Bytes" and "Lines" headers.

XOVER
    Returns the "Subject", "From", "Date", "Message-ID", "References", "Bytes" and "Lines" headers for the indicated article(s).

The rest of the commands given in the NNTP RFC or added in other servers are left out in order to keep the server simple and bug-free.

BUGS
None known.

AUTHOR AND LICENCE
Written by Arnt Gulbrandsen <agulbra@troll.no> and copyright 1995 Troll Tech AS, Postboks 6133 Etterstad, 0602 Oslo, Norway, fax +47 22646949.

Use, modification and distribution is allowed without limitation, warranty, or liability of any kind.

The development of leafnode has been paid for by Uninett AS (http://www.uninett.no/).

SEE ALSO
tcpd(8), hosts.allow(5), fetch(8), texpire(8), RFC 977