.TH leafnode 8 "30 Oct 1995" "Troll Tech AS" \" -*- nroff -*- .\" .\" Written by Arnt Gulbrandsen 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. .\" .\" $Orig-Id: leafnode.8,v 1.13 1997/07/20 00:34:03 agulbra Exp $ .\" .\" hilit19 is stupid: " .\" .\" Copyright (c) 1998,1999,2000 Kazushi (Jam) Marukawa .\" All rights of my changes are reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice in the documentation and/or other materials provided with .\" the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT .\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .SH NAME leafnode \- NNTP server for small (dialup) sites .SH SYNOPSIS .B leafnode .SH DESCRIPTION .B 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. .PP The design of .B leafnode is intended to self-repair after problems, and to require no manual maintenance. .PP The .B leafnode program itself is the NNTP server. It is run from .I /etc/inetd.conf when someone wants to read news. The other parts of the package, .B fetchnews and .B texpire, are responsible for fetching new news from another server, and for deleting old news. .SH "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. .PP I recommend that either firewalling or tcpd be used for access control. .SH FILES All these files and directories .I must be writable by user "news". .PP .I @LIBDIR@/groupinfo contains the information about each USENET group. In case of harm, it is rebuilt by .BR fetchnews (8). .PP .I @LIBDIR@/news-server-name contains the information about every USENET group on each news server. In case of harm, it is rebuilt by .BR fetchnews (8). .PP .I @LIBDIR@/news-server-name.active is an empty file created when .BR fetchnews (8) get information about every USENET group on each news server. .PP .I @LIBDIR@/config contains the configuration parameters for .B leafnode. See CONFIGURATION below. .PP .I /var/spool/news contains the news articles; e.g. .I /var/spool/news/alt/fan/agulbra contains the articles in the .I alt.fan.agulbra group. Each directory contains articles in numbered files (decimal numbers, monotonically increasing), and a special file called .I .overview which contains the "Subject", "From", "Date", "Message-ID", "References", "Bytes" and "Lines" headers for each article in the group. .PP Several subdirectories are special: .PP .I /var/spool/news/out.going contains local postings that .BR fetchnews (8) is to pass to the upstream NNTP server. .PP .I /var/spool/news/failed.postings contains local postings that the upstream server rejected. .BR fetchnews (8) will create files in this directory, but none of the .B leafnode programs will delete anything in it. .PP .I /var/spool/news/message.id contains hard links to each message; this is used in place of the .B dbz database typically used by bigger servers. (A directory such as this is probably more efficient for the small servers .B leafnode is designed for but scales very badly.) .PP .I /var/spool/news/interesting.groups contains one 0-byte file for each group an NNTP client has asked to read. .B 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 .BR fetchnews (8) will retrieve all new articles in all groups whose files have been either .IP - touched during the past timeout_short (see CONFIGURATION below) days, or .IP - touched more than once, and at least once within the past timeout_long (see CONFIGURATION below) days. .PP .I /etc/inetd.conf contains the line which starts .B leafnode. It is strongly recommended to start .B leafnode as user news. .SH CONFIGURATION All configuration is done using the file .I @LIBDIR@/config. There is no GUI configuration tool yet. .PP 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 an example which demonstrates all the bells and whistles: .PP .in +5 fqdn=myserver.mydomain .br server=news02.bigprovider.com .br server=newspost.otherprovider.ne.jp .br postable=1 .br port=128 .br username=username .br password=password .br newsgroups=alt.* .br filteredngs=alt.*binaries.* .br newsgroups=fj.* .br server=nntp.throught.ssh .br viahost=localhost .br port=1234 .br preconnect = su ssh-local-user -c "ssh -f -C -L 1234:nntp.throught.ssh:119 -l ssh-remote-user ssh-server sleep 20 > /dev/null" .br timeout_open=600 .br timeout_read=600 .br supplement=sex.and.warez.com .br # avoidances to fetch articles .br timeout_short=2 # some users read newsgroups only once unfortunately. .br timeout_long=21 # some news groups don't have many article, so keep it long. .br timeout_active=14 # each 14 day, check new newsgroups. .br expire=7 # don't use much space. .br groupexpire=local.* 21 # preserve local news. .br groupexpire=*linux* 3 # don't use much space. .br maxfetch=1000 # again, don't use much space. .br initialfetch=3000 # again, don't use much space. .br maxold=10 # again, don't use much space. .br maxlines=1000 # again, don't use much space. .br minlines=1 # don't use useless space. .br maxbytes=100000 # don't use much space. .br maxgroups=5 # hate too much cross-posting. .br killsubject=test # skip testing messages .br killsubjecti=money.*making # skip money messages .br killfrom=[Aa]uto # skip all messages from auto-responder. .br killfromaddress=gov # skip all messages from goverment. .in -5 .in -5 .PP "fqdn" is used to specify a machine leafnode+ is running. Normally, it is created from hostname. I suggest you to not set this by hand to avoid msg-id confliction. .PP "server" is used by .BR fetchnews (8) to select what NNTP server to retrieve news from. You can specify several servers. And you can add and decrease servers. But at least one "server" is required. .PP "postable" is used by .BR fetchnews (8) to decide whether this server is postable or not. The first server is marked as postable because of compatible reason. Others are marked as unpostable. So, if you want to allow .BR fetchnews (8) to try to post articles to each server, please write "postable=1" in each server's entry. .PP "port" is used by .BR fetchnews (8) to choose a port number to connect to the NNTP server. .PP "username" and "password" are used by .BR fetchnews (8) to choose a user name and password to be authorized a NNTP connection by the NNTP server. .PP "newsgroups" entries are used by .BR fetchnews (8) to decide whether those news groups will be fetched or not. If a system has fnmatch(), each name of news groups is compared by its function, so you can use shell-styled globbing rules like "fj.*.linux*". Otherwise, it is compared by strcmp() or strncmp(), so you can use only asterisks at the beginning and/or the end like "fj.*", "*.linux" or "*.comp.*". .PP "filteredngs" entries are used by .BR fetchnews (8) to screen news groups. It is an opposite way of "newsgroups." .PP "viahost" is used by .BR fetchnews (8) to choose a host to connect to the NNTP server. It is useful to use ssh forwading ability. .PP "preconnect" is executed by .BR fetchnews (8) before making a connection to the NNTP server. It is used for using ssh forwading ability. Note: you shouldn't break a line in the string. You have to write as same as what you want to execute. .PP "timeout_open" is a timeout value for open of NNTP connection of .BR fetchnews (8). .PP "timeout_read" is a timeout value for read of NNTP connection of .BR fetchnews (8). .PP "supplement" is old leafnode's keyword. On this leafnode+, it is same as "server" so that use "server" entry instead of "supplement." .PP "timeout_short" is a number of days. Newsgroups which have not been read, or have been read only once, during the timeout period are marked as uninteresting. The default value is 2 days. If it is zero, newsgroups once started to read never mark as uninteresting. .PP "timeout_long" is also a number of days. Newsgroups which have not been read at all during the timeout period are marked as uninteresting. The default value is 7 days. If it is zero, newsgroups once started to read never mark as uninteresting. .PP "timeout_active" is again a number of days. The active database of each upstream server is checked after this number of days. The default value is 7 days. .PP "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 .BR texpire (8). This parameter is mandatory. .PP "groupexpire" is a set of one string and the number of days separated spaces. A thread in a newsgroup matched with the string should be kept around the number of days. If a system has fnmatch(), a string is compared by it, so you can use shell-styled globbing rules like "fj.*.linux*". Otherwise, it is compared by strcmp() or strncmp(), so you can use only asterisks at the beginning and/or the end like "fj.*", "*.linux" or "*.comp.*". This many days after it has last been read, a discussion thread will be deleted by .BR texpire (8). .PP "maxfetch" specifies the maximum number of articles .BR fetchnews (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. .PP .B Warning: If you set maxfetch 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. initialfetch=3000 #again, don't use much space .PP "initialfetch" specifies the maximum number of articles .BR fetchnews (8) should fetch from the upstream server in each group at the first connection to the server. By default there is no limit, so a new reader will see all of the available postings. .PP "maxold" specifies the maximum dates of articles .BR fetchnews (8) should fetch from the upstream server in each group. By default there is 10 days limit, so a new reader will see only new postings. .PP "maxlines" specifies the maximum number of lines of articles .BR fetchnews (8) should fetch from the upstream server in each group. By default there is no limit, so a new reader will see all of the available postings. .PP "minlines" specifies the minimum number of lines of articles .BR fetchnews (8) should fetch from the upstream server in each group. By default there is no limit, so a new reader will see all of the available postings. .PP "maxbytes" specifies the maximum size of articles .BR fetchnews (8) should fetch from the upstream server in each group. By default there is no limit, so a new reader will see all of the available postings. .PP "maxgroups" specifies the maximum number of cross-posted news groups of articles .BR fetchnews (8) should fetch from the upstream server in each group. By default there is no limit, so a new reader will see all of the available postings. .PP "killsubject" specifies the subject pattern of articles .BR fetchnews (8) should NOT fetch from the upstream server in each group. By default there is no limit, so a new reader will see all of the available postings. This pattern is compared by using regular expression library for speed instead of fnmatch function, so this pattern must be written in the regular expression. For example, "money.*make" is needed instead of "money*make". However, if a system has no regular expression, every subject is compared by strstr(). In this case, please write "money make" instead. .PP "killsubjecti" specifies the killing subject pattern like "killsubject". However, this pattern ignores case distinction. .PP "killfrom" specifies the from pattern of articles .BR fetchnews (8) should NOT fetch from the upstream server in each group. By default there is no limit, so a new reader will see all of the available postings. This pattern is compared by using regular expression library for speed instead of fnmatch function, so this pattern must be written in the regular expression. .PP "killfromaddress" specifies the killing from pattern like "killfrom". However, this pattern is compared with address field only. .PP In addition, "maxage" and "maxcrosspost" are also used as same as Cornelius's leafnode. They are added to increase compatibility. .SH PROTOCOL Here are the NNTP commands supported by this server. .TP .B ARTICLE Return the headers and body text of an article. .B 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. .TP .B BODY Return the body text of an article. See .B ARTICLE. .TP .B GROUP Sets the current USENET group and article pointer, and returns the status information about this group. .TP .B HEAD Return the headers of an article. See .B ARTICLE. .TP .B HELP Accepted but I'm afraid it is not very helpful. .TP .B IHAVE Known but rejected. See .BR fetchnews (8). .TP .B LAST Moves the article pointer back by 1. .TP .B LIST Lists the available USENET groups. .TP .B LISTGROUP Lists the articles present in the current group, or the argument group if an argument is present. .TP .B MODE Accepted and blithely ignored. .TP .B NEWGROUPS Accepted but the reply is always empty. This command does not make sense for this server. .TP .B NEWNEWS Accepted but the reply is always empty. This command does not make sense for this server. .TP .B NEXT Moves the article pointer forward by 1. .TP .B POST Post a new article. Only scant syntax checking is performed. The article is sent to the upstream NNTP server by .BR fetchnews (8). .TP .B QUIT Quit reading news. .TP .B SLAVE Accepted but ignored. .TP .B STAT Return the availability of an article. See .B ARTICLE. .TP .B XHDR Accepted, but supported only for the "Subject", "From", "Date", "Message-ID", "References", "Bytes" and "Lines" headers. .TP .B XOVER Returns the "Subject", "From", "Date", "Message-ID", "References", "Bytes" and "Lines" headers for the indicated article(s). .PP 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. .SH BUGS None known. .SH "AUTHOR AND LICENCE" Written by Arnt Gulbrandsen and copyright 1995 Troll Tech AS, Postboks 6133 Etterstad, 0602 Oslo, Norway, fax +47 22646949. .PP Modified by Kazushi (Jam) Marukawa . Copyright of the modifications 1998,1999,2000. .PP Use, modification and distribution is allowed without limitation, warranty, or liability of any kind. .PP The development of .B leafnode has been paid for by Uninett AS (http://www.uninett.no/). .SH SEE ALSO .BR tcpd (8), .BR hosts.allow (5), .BR fetchnews (8), .BR texpire (8), .BR checkgroups (8), .B "RFC 977"