Previous Next Table of Contents

13. INN-configuration

First one has to install INN of course. You may use either a preconfigured binary or a self-compiled one, which shouldn't be too hard using the example-config.date from the newspak. I made the following changes (this is NOT the whole config.data, but only the differences between config.data.newspak and my configuration):


_EXITVAL               void
INEWS_PATH             DONT
INND_NICE_KIDS         DO
INND_NICE_VALUE        10
DEFAULT_CUTOFF         30
HAVE_UUSTAT            DO
_PATH_LOGFILE          /var/log/inn/log
_PATH_MOST_LOGS        /var/log/inn

I changed the paths so that for NEWSPAK_NEWS_LIB_DIR /usr/local/lib/news is used and for NEWSPAK_SPOOL_DIR /var/spool/news. As far as I know Slackware uses /usr/lib/news, so one has to make either a link or to make the apt changes.

After the installation you have to make some changes in /usr/local/lib/news and its subdirectories. I'll discuss the files to be configured one after another:

First some smaller files: /usr/local/lib/news/passwd.nntp and /usr/local/lib/news/nntpsend.ctl should only contain comments and nothing else. /usr/local/lib/news/hosts.nntp contains only the following line:


##  hosts.nntp - names and addresses that feed us news
##  Format
##      <host>:
##      <host>:<password>
##  <host> can be a name or IP address; no wildcards.  Any hosts not
##  listed here are handed off to nnrpd.
spinnaker.rhein.de:

So only my own computer is allowed to access my NNTP-server.

/usr/local/lib/news/nnrp.access should look like this:


##  nnrp.access - access file for on-campus NNTP sites
##  Format:
##      <host>:<perm>:<user>:<pass>:<groups>
##  Connecting host must be found in this file; the last match found is
##  used, so put defaults first.
##      <host>          Wildcard name or IP address
##      <perm>          R to read; P to post
##      <user>          Username for authentication before posting
##      <pass>          Password, for same reason
##      <groups>        Newsgroup patterns that can be read or not read
##  To disable posting put a space in the <user> and <pass> fields, since
##  there is no way for client to enter one.
##
## Default is no access, no way to authentication, and no groups.
*:: -no- : -no- :!*
##  Foo, Incorporated, hosts have no password, can read anything.
*:Read Post:::spinnaker*
localhost:Read Post:::*
spinnaker.rhein.de:Read Post:::*

So everybody has read and write access via NNRP (that's the protocol with that newsreader communicate with the newsserver) to the newsgroups, whose name begins with spinnaker. They are not allowed to read any other newsgroups. On my own computer everybody has the permission to read and write in every newsgrup.

Next you have to configure /usr/local/lib/news/inn.conf like this:


##  inn.conf -- inn configuration data
##  Format:
##      <parameter>:<whitespace><value>
##  Used by various programs and libinn.  The following parameters are defined:
##      domain          Local domain, without leading period.
##      fromhost        What to put in the From line; default is FQDN
##                      of the local host.
##      moderatormailer Where to mail moderated postings, if not found
##                      in the moderators file; see moderators(5).
##      pathhost        What to put in the Path and Xref headers; default
##                      is FQDN of the local host.
##      organization    If $ORGANIZATION doesn't exist.  What to put in
##                      the Organization header if blank.
##      server          If $NNTPSERVER doesn't exist.  Local NNTP server
##                      host to connect to.
##
organization:   private site, Widdig, Germany
#server:        spinnaker.rhein.de
server:         localhost

The most important file of the INN-configuration is /usr/local/lib/news/newsfeeds which defines, which newsgroups are exported to whom.


##  newsfeeds - determine where Usenet articles get sent
##  Format:
##      site[/exclude,exclude...]\
##              :pattern,pattern...[/distrib,distrib...]\
##              :flag,flag...\
##              :param
##  Summary of flags:
##      <size           Article must be less then size bytes.
##      Aitems          Article checks -- d (must have Distribution header)
##                      p (don't check for site in Path header).
##      Bhigh/low       Internal buffer size before writing to output.
##      H[count]        Article must have less then count hops; default is 1.
##      Isize           Internal buffer size (if a file feed)
##      Nm              Only moderated groups that match the patterns.
##      Nu              Only unmoderated groups that match the patterns.
##      Ssize           Start spooling if more than size bytes get queued.
##      Ttype           Feed types -- f (file) m (funnel; param names the
##                      real entry) p (pipe to program) c (send to stdin
##                      channel of param's sub-process); x (like c, but
##                      handles commands on stdin).
##      Witems          What to write -- b (article bytesize) f (full path)
##                      g (first newsgroup) m (Message-ID) n (relative
##                      path) s (site that fed article) t (time received)
##                      * (names of funnel feed-in's or all sites that get
##                      the article) N (Newsgroups header) D (Distribution
##                      header) H (all headers) O (overview data) R
##                      (replication data).
##  Param field depends on T flag.  For Tf, relative paths are from the
##  out.going directory.  For Tp and Tc, it is a shell command to execute.
##  If a Tm refers to this entry (which will have its own T param) then "*"
##  is expanded to all the funnel sites that triggered this one.  Useful
##  for spawning one mail process, e.g.
##
##  This file is complicated -- see newsfeeds.5!

# ME shows, which newsgroups should be accepted
ME\
        :!*\
        ::

# Everything, which should be sent via FidoGate:
# - fido.* except fido.junk, because this is a pseudo newsgroup where
#   only those articles are stored which are not entered correctly
#   into FidoGate's areas file, 
# - ger.*, the gernet-newsgroups
# If Internet is received via fido (e.g. via fido.de), the Internet
# newsgwroups (rec.*, comp.*, de.*, alt.*, gnu.*,...) have to be
# inserted here, too.
#
# All my ftn-uplinks have the same name (configured in
# /usr/local/lib/fidogate/hosts), here it is flokiste.fido.de.  So
# this name has to be added here, otherwise articles coming here via
# flokiste.fido.de would be sent back es dupes to flokiste.fido.de.
#
# To keep Fido and Internet seperatly (I don't want that any posting
# received via Fido is exported via Internet and vice versa), I
# inserted rhein as an additional alias for this system.
fidogate/flokiste.fido.de,rhein\
        :fido.*,!fido.junk,ger.*\
        :Tf,Wnb:

# This is my Internet (usenet)-feed.
# Here we export the areas comp.*, de.*, rec.*, alt*, gnu.*,...
# To suppress exporting articles which originally come from Fido, I
# added flokiste.fido.de as an alias for rhein.
rhein/flokiste.fido.de\
        :comp.*,de.*,rec.*,alt.*,gnu.*\
        :Tf,Wfb:

Then you have to configure /usr/local/lib/news/expire.ctl, which defines when which newsgroups expire.


##  expire.ctl - expire control file
##  Format:
##      /remember/:<keep>
##      <patterns>:<modflag>:<keep>:<default>:<purge>
##  First line gives history retention; other lines specify expiration
##  for newsgroups.  Must have a "*:A:..." line which is the default.
##      <patterns>      wildmat-style patterns for the newsgroups
##      <modflag>       Pick one of M U A -- modifies pattern to be only
##                      moderated, unmoderated, or all groups
##      <keep>          Mininum number of days to keep article
##      <default>       Default number of days to keep the article
##      <purge>         Flush article after this many days
##  <keep>, <default>, and <purge> can be floating-point numbers or the
##  word "never."  Times are based on when received unless -p is used;
##  see expire.8

##  If article expires before 14 days, we still remember it for 14 days in
##  case we get offered it again.  Depending on what you use for the innd
##  -c flag and how paranoid you are about old news, you might want to
##  make this 28, 30, etc.
/remember/:30

# Keep all newsgroups minimal 3, maximal 90 and normaly 5 days (from
# arrival) 
*:A:3:5:90
*:U:3:5:90
# Keep moderated newsgroups a bit longer
*:M:5:9:90

# Keep local newsgroup 3 months.
spinnaker.*:A:3:90:90

# Keep german newsgroups 7 days
de.*:A:3:7:90
# de.comp.os.linux.* a bit longer.
de.comp.os.linux.*:A:3:14:90

# Keep the moderated c.o.l.* 3 months.
comp.os.linux.*:M:5:90:90

# Keep fido some longer as default.
fido*:A:3:9:90
ger*:A:3:8:90

# Remove the junk very quick.
fido.junk:A:3:4:90

# And another exception:
fido.ger.linux:A:3:24:90

Of course you may define this on your own needs. But you shouldn't decrease the default-times (especially for Fido) too much, as the messages take a long time to your system and so might expire immeadiately.

Now create the file /usr/local/lib/news/send-fidogate that will periodically pack the Fido-echomail. You can find a prototype of this file in fidogate/config/inn/send-fidogate, but you have to make some little changes in the beginning of the file:


 #! /bin/sh
 #:ts=8
 ##  SH script to send batches to FIDOGATE

 ##  =()<. @<_PATH_SHELLVARS>@>()=
 . /usr/local/lib/news/innshellvars

 #
 # FIDOGATE rfc2ftn
 #
 RFC2FTN="/usr/local/lib/fidogate/rfc2ftn -w Normal -b -n "

To get the news exported, there must be a batch-directory for them, which is called /var/spool/news/out.going, with owner news.news and permission 775. In contrast to cnews there mustn't be any subdirectories in this directory for the newsfeeds, as INN uses only one file per feed which it creates itself. If you "upgrade" from cnews to INN, you should delete the existing directories.

As INN works with a daemon, which always runs, it must be started in the boot-process. Add the following at the end of /etc/rc.d/rc.M before the call of rc.local:


  /usr/local/lib/news/etc/rc.news &

For the first test of INN this script can be started manually (as user root). But be careful, that only one innd is running at the same time.

In some distributions another NNTP-daemon (nntpd) is defined for cnews in /etc/inetd.conf. Then innd can't be started, as the TCP-port is already busy. That's why you have to comment this line out and restart inetd with a kill -1.

To make INN work properly you have to add the following to the crontab of the user news:


SHELL=/bin/sh
MAILTO=roland
#
# INN:
#
13  *   * * *   /usr/local/lib/news/send-fidogate
17  *   * * *   /usr/local/lib/news/send-uucp rhein
13  21  * * *   /usr/bin/nice /usr/local/lib/news/bin/news.daily delayrm
48  21  * * *   /usr/local/lib/news/rnews -U

Every hour the batches for all Fido-systems and the UUCP-system rhein are packed (without a UUCP-connection you can skip the last part of course). Furthermore there's a daily clean-up, which is reported via mail. Then all accidentally not-delivered articles will be processed.

The next thing we've got to do is creating the newsgroups. Therefore and for almost all other changes in the news system only the command ctlinnd is used. It should be called only by the user news and you can find it in the directory /usr/local/lib/news/bin.

New newsgroups are created with ctlinnd newgroup fido.ger.linux (where fido.ger.linux is only an example). You can use various options, which are explained in the manpage of ctlinnd(8). You should create the newsgroups control, junk and fido.junk, which contain the control-messages (e.g. cancel), articles for unknown newsgroups and articles for not in /usr/local/lib/fidogate/areas defined areas.

To find the descriptions of the newsgroups in the newsreader, you may want to create the file /usr/local/lib/news/newsgroups, which contains the name of a newsgroup and its description (seperated by a TAB) in every line. The order of the groups is irrelevant, from a duplicate line only the first one is shown.

As INN reports his log-messages via syslog, one should make these changes in /etc/syslog.conf:


news.crit                               /var/log/inn/news.crit
news.err                                /var/log/inn/news.err
news.notice                             /var/log/inn/news.notice

Furthermore create the directory /var/log/inn.

For further information on INN, an upgrade from a cnews-system to INN, problems etc. please read the very good INN-FAQ and the manpages.


Previous Next Table of Contents