[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SLUG] Email Dream Team



On Wed, Jun 06, 2001 at 11:30:57AM +1000, John Clarke wrote:

> > How do you set up a News server so that the box continually grabs 
> > messages and stores them for later reading even when not logged on?
> 
> I run innd and use suck to grab the newsgroups I want from my ISPs and
> point my newsreader to my news server.  I posted details of how to set
> this up to the list, but the archives don't go back far enough (six or
> seven years, maybe more).  I may still have a copy at home, I'll have a

Sorry for the delay, I've been a little busy.  I couldn't find my old
notes, so based on the setup here at work, I've written some new ones. 
They're pretty rough, but should be enough to get you started.

Let me know if you find any errors or have any questions.


Cheers,

John
-- 
And "clitmouse" doesn't give the wrong idea?  Since when does one
control the pointer on the screen by moving one's tongue around
on the little nubbin?  -- Matt McLeod
Setting up a news server with inn and suck
==========================================

This is a *very* rough guide to setting up your own news spool using
innd and suck.  There are other options, for example, leafnode for the
news spool.  Search freshmeat.net if you're interested.

For best results, read the man pages and other documentation before you
start.

Any examples in this document are taken from a real system, so they
contain hostnames and other information that you'll need to change to
suit your configuration.  Do not cut and paste these examples blindly;
you probably don't have authorisation to connect to the servers we use.


If you find any errors in this document, please let me know.

        John Clarke <johnc@nospam.kirriwa.net>
        19 June 2001


1.  Check you can talk to your isp's news server
================================================

First, check that you can read news from your isp's news server.  Set
NNTPSERVER, fire up your favourite news reader and see what happens. 
If this doesn't work, fix it before you go any further.  You need this
working because to your isp's news server, suck looks just like any
other news reader.


2.  Setup innd
==============

Next, get and install innd.  If your distro includes a package, just
install that.  Otherwise you'll need to get the source and build it. 
That's outside the scope of this guide; you'll have to figure that out
for yourself.

Paths in this guide are for Redhat's rpms; I don't know whether other
distros put files elsewhere.


File: /etc/news/actsync.cfg

    Insert a line like this:

        host=news.syd.connect.com.au
        
    Use the name of your isp's news server.


File: /etc/news/expire.ctl

    If you want to change the expiry times (the length of time an article
    is held in the local spool), change this file, e.g.:

    #  keep for at least 5 and up to 15 days, default 10 days
    *:A:5:10:15

    # keep vast.general for 90 days always
    vast.general:A:90:90:90
    
    vast.general is a local news group here.  It's simply provided as an
    example.


File: /etc/news/inn.conf

    Change the `organization', `server', `fromhost' and `pathhost'
    fields to suit your needs.  There are a lot more fields in this
    file, most can be left at the default settings.  Read the man page
    for help if you're unsure.


File: /etc/news/newsfeeds

    This file is complex, you really should read the docs before you
    touch it.  I've simply cut and pasted the relevant bits from mine.
    vast.* are local newsgroups here; I've included them as an example
    of how to prevent local newsgroups being fed to your isp's server.


    # Default of  everything to everybody except for junk, control, anything
    # with "vast" as the newsgroup prefix (i.e. matches "vast.general").
    ME:*,!junk,!control,!vast::

    # feed to `connect'.  Exclude articles that have `news.syd.connect.com.au'
    # or `merki.connect.com.au' in the Path header (news.syd is a CNAME for 
    # merki).  Exclude junk, control and vast.*, write the relative path and 
    # message id to a file called `connect' in /var/spool/news/outgoing
    connect/news.syd.connect.com.au,merki.connect.com.au\
    	:*,!junk,!control,!vast.*:Tf,Wnm:connect


File:   /etc/news/nnrp.access

    This file controls who has access to the news server, e.g.:

    # Default to no access
    *:: -no- : -no- :!*
    # Allow access from localhost
    localhost:Read Post:::*
    # and any host in vastsystems.com.au
    *.vastsystems.com.au:Read Post:::*


File:   /etc/news/nntpsend.ctl

    Add a line like this:

    # Site `connect' is news.syd.connect.com.au.  The site name must match
    # the name in /etc/news/newsfeeds.
    connect:news.syd.connect.com.au::


File:   /var/lib/news/active

    This file lists the newsgroups available on the local server.  Rather
    than edit this file directly, use ctlinnd to add new groups, e.g.:
    
        ctlinnd newgroup aus.aviation
    
    will add a line like this to this file:

        aus.aviation 0000000000 0000000001 y
    
    Start with just one or two newsgroups until you're sure everything
    works and add any others later.


3.  Check that your new news server works
=========================================

Start innd and check /var/log/messages for errors.  Fire up your
favourite news reader (make sure NNTPSERVER is set to `localhost') and
check that you can connect.  You won't see any articles of course
because you haven't  downloaded any yet.


4.  Setup suck
==============

Get and install suck.  I grabbed the rpm from Redhat's Power Tools, but
it's easy enough to build from source.  Use the script `get.news.inn',
but change the following lines to suit your setup:

    REMOTE_HOST=news.syd.connect.com.au
    SPOOLDIR=/var/spool/news               # base directory for articles to be rposted
    NEWSDIR=/usr                           # base directory for news binaries 
    BASEDIR=/usr/lib/news/suck             # base directory for scripts and data files

    SITE=connect                           # name of site from newsfeeds file

and add this one:

    HISTORYDIR=/var/lib/news

I added this:

    if [ ${LOCAL_RESULT} -ne 0 ]; then
        echo "Local Host not responding"
    fi

after testing the local server (${TESTHOST} ${LOCAL_HOST} -s), and a
similar test after testing the remote server.

I also added these options to the suck command line:

    -i 0 -HF ${HISTORYDIR}/history
    
The first tells suck to grab all available articles in each news group,
the second tells it where to find the history file.

Now create a file called `active-ignore' in $BASEDIR.  Put this in it:

    control
    control.*
    junk
    test
    to

get.news.inn tells suck to grab all newsgroups in the active file.  This file
tells it to ignore some of those groups.  If you have some local newsgroups,
add those too.  For example, I include `vast.*' too.


5.  Make sure that suck works
=============================

Run get.news.inn.  You should see it downloading articles.  If not, fix it.

You don't have to run suck as root.  Just make sure that the file
permissions on /usr/lib/news/suck/... are set accordingly.


6.  Add newsgroups
==================

You can now add as many newsgroups as you want, then run get.news.inn again
to download them from your isp's server.


7.  Schedule get.news.inn to keep the news coming
=================================================

Setup a cron job to run get.news.inn as often as you want.  I run it
once an hour at work where we have a permanent link, and once a day at
home where I'm on a dialup.  The script at home also dials my isp,
starts fetchmail, runs suck, then waits until the mail queue is empty
(or five minutes, whichever comes first) and hangs up.