INN

From Wikislax
Revision as of 22:35, 6 December 2017 by Wikislax (talk | contribs) (Created page with "{{RightTOC}} == What is INN ? == [http://www.isc.org/software/inn/ INN] (InterNet News) is the leading Usenet news software, available from the [http://www.isc.org ISC] webs...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What is INN ?

INN (InterNet News) is the leading Usenet news software, available from the ISC website.

The news articles received from peer servers on the Internet can also be viewed by clients using a newsreader such as slrn or Thunderbird. It is possible to read and to answer to articles.

Installing INN

Download and untar in /usr/local. Installation is described very well in the INSTALL file also available from the isc website. INN runs as the news user. This user is present by default on Slackware, but the home directory must be changed to match INN's : /usr/local/news.

# usermod --home /usr/local/news news
# tar -C /usr/local -xvf inn-x.y.z
# cd /usr/local
# chown -R root:root inn-x.y.z
# cd inn-x.y.z
# less INSTALL
# ./configure --help | less
# ./configure --prefix=/usr/local/news --libdir=/usr/local/news/lib64 --mandir=/usr/local/man \
--with-sendmail --with-perl --with-python --with-berkeleydb --with-zlib --with-openssl --with-sasl
# make
# make install
# make clean

Configuring INN

INN runs as the news user, so login or su as news in order not to break the file permissions. There are 27 configuration files ! but it's possible to work only with a small subset of files minimally modified. In addition the default configuration files provided with the software are very well written and commented, and man pages are available.

inn.conf : main configuration file, to specify the host, path, and certificates. As INN is ran as news, let us make a copy of the server private key hat will be readable only by this user :

# cd /etc/ssl/private
# cp mtakey.pem.unsecure news.mtakey.pem.unsecure
# chown news:news news.mtakey.pem.unsecure
# cd /usr/local/news/etc
# vi inn.conf

inn.conf : general options of the program. The line organization must be modified, replacing A poorly-installed InterNetNews site by your organization name. ovhmethod is the method used to store overview data. ovdb looks more efficient than the others so we've chosen that. artcutoff is the retention duration of the articles in number of days. It is not possible to feed your site with articles older than this value, that it can be interesting to increase as by default it is only 10 days. The pathhost must contain the site FQDN, that must be resolvable (for instance present in the /etc/hosts file).

mta:                    "/usr/sbin/sendmail -oi -oem %s"
organization:           "studioware"
pathhost:               inner.studioware.com
pathnews:               /usr/local/news
artcutoff:              366

tlscafile:              /etc/ssl/certs/cacert.pem
tlscapath:              /etc/ssl/certs
tlscertfile:            /etc/ssl/certs/mtacert.pem
tlskeyfile:             /etc/ssl/private/news.mtakey.pem.unsecure

cycbuff.conf : configuration of cyclic buffers. Cyclic buffers are a more efficient version of the article storage mode, in a reduced number of files or in block peripherals.

cycbuff:ONE:/var/news/cycbuffs/one:512000
cycbuff:TWO:/var/news/cycbuffs/two:512000
metacycbuff:ONETWO:ONE,TWO

Create the files using :

# mkdir -p /var/news/cycbuffs
# chown -R news:news /var/news
# chmod -R 750 /var/news
# usermod -s /usr/bin/bash news
# usermod -d /usr/local/news news
# su news
$ dd if=/dev/zero of=/var/news/cycbuffs/one bs=1K count=512000
$ dd if=/dev/zero of=/var/news/cycbuffs/two bs=1K count=512000
$ chmod 640 /var/news/cycbuffs/*
<ctrl>d
#

expire.ctl : expiration of articles. remember indicates the period during which the message headers will be kept after body elimination. This is to avoid re-taking the articles if offered again. Other options do not apply when using cyclic buffers. In this case expiration is on a first in first out basis.

/remember/:366

incoming.conf : this file affords defining the sites with which you have agreements and that feed you in fresh news. As there are probably none, you do not need to modify it. How are you going to feed your site then ? Using an external feeding software sucknews, which presents itself to your Internet Service Provider like a simple news reader. sucknews is described in detail further on.

newsfeeds : list the newsfeeds that you are going to manage. A file with the name specified will be created in /usr/local/news/spool/outgoing and will contain one line per article to post. In the following example, all the groups except control and junk will be posted.

free\
    :*,!junk,!control*\
    :Tf,Wnm:

readers.conf : list of access authorizations. For a general access, except to the control groups :

auth "theworld" {
    hosts: *
    default: "<theworld>"
}

access "theworld" {
    users: "<theworld>"
    newsgroups: "*,!control*,!junk"
    access: RPA
}

storage.conf : general options for articles storage. In the example, cnfs corresponds to the cyclic buffers :

method cnfs {
    newsgroups: *
    class: 2
    options: ONETWO
}

Next step is to initialize the history database :

# su news
$ cd /usr/local/news
$ bin/makedbz -i -s 100000 -o
<ctrl>d

INN sends maintenance mails to the news user, so we need to create the person in OpenLDAP and the mailbox in Cyrus-IMAP  :

# cd /usr/local/etc/openldap
# vi news.ldif
i
dn: cn=news,dc=domain,dc=com
objectclass: person
cn: news
sn: news
userPassword: myPassword
:x
# ldapadd -x -D "cn=Manager,dc=studioware,dc=com" -W -f news.ldif
# cyradm --user postmaster --auth plain localhost
Password: 
localhost> cm user.news
localhost> cm user.news.Drafts
localhost> cm user.news.Junk
localhost> cm user.news.Sent
localhost> cm user.news.Trash
localhost> sq user.news 307200
quota:307200
localhost> quit

INN executes the daily script news.daily, which writes its report in file news.daily, then addressed to the news user. Execution of news.daily must be configured in the news crontab. Here is an example for a daily execution at 13:30 :

# su news
$ crontab -e
# MIN HOUR DAY MONTH DAYOFWEEK COMMAND
# 00 13 * * * /usr/local/news/bin/suck.sh
30 13 * * * /usr/local/news/bin/news.daily expireover lowmark

Add usenet user to /etc/mail/aliases and run newaliases :

# redirect news
usenet:         news

# newaliases
/etc/mail/aliases: 16 aliases, longest 10 bytes, 172 bytes total

INN should now be ready to work.

Running INN

To start INN automatically at system startup add these lines to the /etc/rc.d/rc.local file :

# start inn
if [ -x /usr/local/news/bin/rc.news ]; then
        echo "Starting inn: sudo -u news /usr/local/news/bin/rc.news start"
        sudo -u news /usr/local/news/bin/rc.news start
fi

To stop INN automatically at system shutdown add these lines to the /etc/rc.d/rc.local_shutdown file :

# stop inn
if [ -x /usr/local/news/bin/rc.news ]; then
        echo "Stopping inn: sudo -u news /usr/local/news/bin/rc.news stop"
        sudo -u news /usr/local/news/bin/rc.news stop
fi

Getting Articles

The list of Newsgroups to relay can be defined by editing the db/active file manually (innd must be stopped) or using ctlinnd. The definitions take no wildcard, meaning that the Newsgroups must be entered one by one. The ISC maintain a list.

# sudo -u news /usr/local/news/bin/rc.news start
Starting innd.
Scheduled start of /usr/local/news/bin/innwatch.
# /usr/local/news/bin/ctlinnd newgroup alt.os.linux.slackware y jpmenicucci@studioware.com
Ok

But as no news peer has been defined in our configuration INN will not get articles for these newsgroups. So we'll have to get them from our Internet Service Provider in an other way, using as alternative the sucknews software. That's the object of next page.


RoundCube Main Page Sucknews