Leafnode Local News Server

Leafnode is configured to determine what, and how many, articles to retrieve. It manages article clean-ups in the background. Combined with filtering, one can use any email client with NNTP support. Evolution is completely tamed by Leafnode. One client; One address book; One set of signatures.

Leafnode may be particularly beneficial if you regularly post to moderated news groups. You may have experienced a problem (depending upon the news group) where clients like knode or T-bird hang, time out and then incorrectly show the post as failed; The post remains in the outbox. Leafnode handles this, quite gracefully, in the background.

Degree of Difficulty:Easy to Moderately Complex

Requirements:The leafnode RPMDependency=xinetd
Our simplified configuration file
A basic understanding of regular expressions to configure filters.
Minimal disk space.
Please note that the current RPM available from Fedora Extras is outdated.

Leafode a la Carte:

I’m almost reluctant to include this section since most people can run leafnode without any intervention. At the risk of over-complicating the matter, these are the components that are included with leafnode; Each has its own man page:

leafnode:
The daemon that runs as an xinetd service.
fetchnews:
Runs at regular intervals via a cron job. Posts and retrieves new messages. Polls for new groups. If you are anxious to get a post transmitted just run “fetchnews.” If you want to see what it’s doing, run “fetchnews -v.”
newsq [-f]:
Shows the contents of the outgoing queue; newsq -f shows failed postings.
applyfilter:
Applies new filters to articles already downloaded.
texpire:
The maintenance and cleanup module. Runs from a daily cron job that the leafnode rpm automatically creates (/etc/cron.daily/leafnode).

The leafnode home page is here. If you like it, consider a PayPal donation.

1. Download and Install the Required Files

If you haven’t already done so, click on the links, above and download the RPM and simplified configuration file. Install the rpm as root and move or copy leafnode.conf to /etc/leafode/config, overwriting the existing file.

2. Edit the Configuration File (Quickstart Configuration)

Open /etc/leafnode/config in your text editor of choice.

The file is divided into three sections; Must Change, Might Change and Don’t Change. The only thing that you must change is the name of the news server that leafnode will connect to. If your ISP requires credentials for news, enter your user-name and password. Other things that you might want to change are additional servers and some simple parameters that are explained below.

The Don’t Change section contains good, working default parameters that should allow you to get up and running. It’s probably best not to futz with these settings for now. The original config file is appended. This contains even more settings that you can tinker with to break your installation.

Must Change

server = news-server.your-isp.net
#enter your news server here

Might Require Changes

# username = user
# password = pwd
#Authentication for server 1 if required.

Additional Servers
#
# server = forums.novell.com
#
# server = news.grc.com
# username = user
# password = pwd #

Parameters you should review

initialfetch = 2000
# The number of articles initially downloaded
maxfetch = 2000
# Maximum new articles to retrieve
maxcrosspost = 6
# Eliminates spam cross posted to more than six news groups
maxbytes = 25000
# Rejects articles larger than setting. You’ll probably need to increase this (or comment it out) if you subscribe to binary news groups

3. Edit the xinetd File

In your text editor, open /etc/xinetd.d/leafnode. Change “disable = yes” to “disable = no.” It should look like this:

service nntp
{
        disable         = no
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = news
        server          = /usr/sbin/leafnode
#       bind            = 127.0.0.1
}

When running this on a standalone machine, uncomment the “bind” line for additional security. Leafnode will then only be accessible on address “127.0.0.1”. This address is invisible to remote computers.

4. Activate the Services

chkconfig –level 12345 xinetd on
chkconfig –level 12345 leafnode on
service xinetd restart

5. Create a fetchnews Cron Job

The following example will poll for new articles in all groups and post new articles every ten minutes.

10 * * * *      fetchnews >/dev/null

6. Setup Your News Reader

Setup is simple. Just point your news client at the machine running leafnode.

There are a couple of differences when using leafnode:

  1. Leafnode creates a combined, single group list for all servers that it posts from.
  2. When you subscribe to a newsgroup, leafnode presents a header message. The next time that fetchnews runs, it will download articles from the new news group.

7. Filters

Leafnode uses regular expression filters that can be applied to any header. Fetchnews will not download any article with a filter match. The filter file is located at /etc/leafnode/filters. Here are some examples:

^Newsgroups:.*alt.flame #-No articles cross-posted to alt.flame
^From.*\barbara<.schwarz;@gmail\.com> #-No articles from a specific kook
^Subject.*REPOST #-No reposted articles
^NNTP-Posting-Host.*hinet.net #-No articles originating from spammer
^X-Newsreader.*NNTP.SCRIBBLER #-No articles posted by spam software

Please use the contact form for comments, suggestions, questions, corrections, rants and raves.

You May Also Like

FC3 – Building a Custom Kernel

Linux Diversions

RBLDNSD Blocklist for Postfix