This page has drawn heavily from information contained on the slrn website, from the now defunct slrn page on Andrew's Corner of the Web and also from guidance and advice obtained from the users of news.software.readers. Thanks to all for the generous permission to use their work!

What is slrn?

slrn ('S-Lang read news') is a console based newsreader which is used to access Usenet newsgroup messages. Beside the usual features of a newsreader slrn also supports scoring rules to highlight, sort or kill articles based on information from their header. It is highly customizable, allows free key-bindings and can easily be extended using the sophisticated S-Lang macro language.

Website: http://slrn.sourceforge.net/

Some Preparation

slrn is a relatively complex piece of software to install and setup correctly, some preparation work is involved before installing slrn itself:

Set a FQDN

The most correct setup of slrn requires your computer to have a Fully Qualified Domain Name (FQDN). A default Ubuntu setup will often not have this set and the setting in /etc/hosts will look something like this:

127.0.0.1       localhost
127.0.1.1       desktop

This should be altered to reflect your own unique FQDN. For this you have 3 good choices:

  1. If you own your own Domain Name use this in conjunction with a subdomain and the hostname of your computer.
  2. Use a service such as dyndns.org which will give you a domain name for free.

  3. Use the news service individual.net which will give you a free FQDN.

Once this is in place alter the /etc/hosts file to reflect the FQDN with the following syntax:

127.0.0.1       localhost
127.0.1.1       desktop.your.domain     desktop

It is well worthwhile to set your your system correctly in this way and especially worthwhile to ensure that the FQDN is both unique and authentic.

Install msmtp

It is usually not good Usenet etiquette to send an email reply rather than post directly to the newsgroup. On rare occasions however this may be required and for this to succeed a suitable sending agent should be installed. The easiest and most flexible of these is msmtp and it can easily be set to deliver via a Gmail account which I demonstrate below. To install:

sudo apt-get install msmtp ca-certificates

A configuration file is required:

touch $HOME/.msmtprc
touch $HOME/.msmtp.log
chmod 0600 $HOME/.msmtprc

and the following details will need to be added to this configuration file:

account default              
host smtp.gmail.com          
port 587                     
from full.gmail.address@gmail.com 
tls on                       
tls_starttls on              
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth on                     
user gmail.username        
password mypassword       
logfile ~/.msmtp.log

Note: You will need to place your own values for from, user and password. Don't feel obligated to use Gmail as msmtp will work with most mail accounts. This completes the set for msmtp and it remains only to add a reference to msmtp in the .slrnrc file which will be explained later in this guide.

Choose an Editor

slrn does not come with an editor so either the system's default editor will be used or an editor must be specified from the slrn configuration file. For the purposes of this page the venerable editor vim will be used:

sudo apt-get install vim

but I would strongly recommend running the command vimtutor after opening vim for the first time to get acquainted with this often quirky editor. Other excellent choices for editor would be jed, nano, pico or even gvim.

Set the NNTP Environment Variable

slrn will need to know where the news server is and the recommended way to do this is to place this address in your .bashrc file:

# Sets the News Server Environment as required by slrn
NNTPSERVER='my.news.server' && export NNTPSERVER

Obviously you will need to substitute details of your news server where 'my.news.server' is quoted above.

Completing the setup

There are still a few small steps to follow until slrn is ready to run including installing slrn from the Ubuntu Repository, setting up the ~/.slrnrc file and running some commands to create a newsrc file and download group descriptions. First to install slrn itself:

Install slrn

Ubuntu is fortunate in that for the most part modern versions of slrn are included in the repositories from Intrepid Ibex onwards. So all that is required to install slrn is:

sudo apt-get install slrn

(For those who wish to live closer to the cutting edge of slrn development details can be seen below for accessing the slrn subversion repository.) Once this is done the next step is to setup the vital configuration file ~/.slrnrc.

Setup the ~/.slrnrc file

The heart and soul of slrn configuration lies in the file .slrnrc and this must be placed manually. A well commented sample file can be placed from the installed slrn documentation as follows:

zcat /usr/share/doc/slrn/examples/slrn.rc.gz > $HOME/.slrnrc

This file is very well commented and for the most part self-explanatory but there are a few vital areas that I will comment on here. One of the important areas is the early section with user details:

% User details and munged hostname:
set realname "Your Real Name"
set username "username"
set hostname "your.host.name.invalid"

% Reply to a different but real email address:
set replyto  "real.address@gmail.com"

% The name of your signature file:
set signature ".signature"

It is a wise idea to place .invalid at the end of your 'hostname' unless you wish to receive a barrage of spam from the Usenet spam harvesters. Equally it is a good idea to place a real address in the 'replyto' field. As for the signature unless you wish to feel the wrath of Usenet style-guardians keep it to 4 lines only and make it witty and/or informative, not annoying or offensive.

The 'editor' section is also very important:

% Set your favorite editor:
set editor_command "vim '+set tw=72' +%d '%s'"

This section is where you need to place details of the external editor that slrn uses to compose and reply to posts. If you have decided on another editor such as nano, pico, jed or gvim details will need to be altered here.

Some comments about authentication and passwords:

% If a server requires authentication, add an nnrpaccess line for it.
nnrpaccess "news.server" "username" "password"

slrn uses this section to place your authentication details with the remote NNTP server. If you do not wish to place your password in a text file in this manner simply omit the password itself, leaving the "", and slrn will prompt you for the details when you log in.

And finally the use of an external transport agent:

% Use msmtp to send email responses:
set sendmail_command "/usr/bin/msmtp -t"

Instead of using sendmail to send off email responses this line sends email via msmtp.For the many, many other settings in this file some old fashioned experimentation will help find the optimal settings but for definitive advice the newsgroup news.software.readers is well worth a visit.

Run slrn for the first time

With the laborious setup complete all that remains is to run the following 2 commands:

slrn --create
slrn -d 

The first reads the active file from the remote NNTP server and creates the default newsrc file for slrn while the second command downloads the group descriptions from the server.

You have now successfully now installed slrn. The program has already subscribed you to a few newsgroups, navigate these by using the arrow keys and enter each group with the space bar. If and when you get stuck in the early stages press the ? key and a list of basic commands will be revealed. Can I suggest a little time on alt.test before venturing on to other groups? And remember that the online home for slrn can be found on news.software.readers. Perhaps I will see you there?

Using slrnpull

slrn includes a very useful application that pulls a small feed from the remote NNTP server, which slrn can then read. This program is known as slrnpull and I would highly recommend you at least have a quick look at it even if you return afterwards to reading the remote server directly.

Installing slrnpull

Although slrnpull is part of the original slrn tarball under Ubuntu it is a separate package and can be installed as follows:

sudo apt-get install slrnpull

The Ubuntu installation may ask you to specify how you wish slrnpull to access the remote NNTP server and for the moment it should be specified Manual.

Configuring slrnpull

A sample configuration file needs to be installed to the correct location:

sudo cp -v /etc/news/slrnpull.conf /var/spool/slrnpull

Open this file and if you read it carefully you can see that it is easy enough to specify the newsgroups you wish to read, the numbers of posts you wish to pull and the time before slrnpull will remove the posts from the spool. If you news server requires authentication you will also need to create a file called authinfo in /var/spool/slrnpull and place your username as the first line and your password as the second. The permissions in the default Ubuntu installation do not allow posting so these need to be adjusted as follows:

sudo chmod ugo+rwxt /var/spool/slrnpull/out.going

This concludes the setup of slrnpull and if all is well the following command should pull in the first set of messages to the spool (in the Ubuntu package the location of the spool does not need to be specified with the -d option):

sudo slrnpull -h 'Your.NNTP.Server'

Obviously you will need to substitute 'Your.NNTP.Server' with the details of your actual server. slrnpull has a few options that can be used on the commandline and these can be seen by running slrnpull --help, an important option of course will be --expire which will clean the spool following expiration rules from slrnpull.conf. If you are not happy to simply run slrnpull from the commandline, as I do, it should be a simple matter to write a small script to run the program and set it to run at the time interval of your choice from cron.

Configuring slrn to read the spool

A few settings should be added to ~/.slrnrc and the following should cover the essentials:

set spool_inn_root   "/var/spool/slrnpull"
set spool_root       "/var/spool/slrnpull/news"
set spool_nov_root   "/var/spool/slrnpull/news"
set read_active      1
set use_slrnpull     1
set post_object      "slrnpull"
set server_object    "spool"

This should allow to slrn to read directly from the spool and also post directly to it. There is a lot more that slrnpull can do and I encourage you to read the online documentation thoroughly to get the most out of this amazing little program.

Advanced slrn usage

The directions given above will certainly get slrn running and running well, but there are a few more areas that can be explored and this section aims to speak of some of these areas.

Utilising macros

slrn can be extended by the usage of macros and several of these ship with the Ubuntu installation. One such macro is called 'color.sl'. This macro implements a function called 'edit_colors' that may be used for designing a color scheme interactively. It can be called from the ~/.slrnrc file as follows:

interpret "color.sl"
setkey article edit_colors "\eec"

This sets the keys 'ESC e c' to call a macro that will interactively select a color scheme by choosing an object, foreground color and background color. There are several other macros that come with the standard slrn installation, for example one that allows improved searching, another that allows better sorting of the group list, and I encourage you to explore these.

It is also possible to utilise macros that have been authored by enthusiastic slrn users and these can be garnered from newsgroups, personal websites and also from the page of the slrn website exclusively devoted to macros. A very nice example of such a macro is the create_msg_id.sl macro developed by Troy Piggins, it allows for the creation of an unique Message-ID in the following format:

Message-ID: <20080426081643.549@ilium.andrews-corner.org>

This example is drawn from my own setup but it can be seen that the MID is of course yyyymmddhhmmss followed by three random characters and finally subdomain and domain. Providing your FQDN and your computer clock are set correctly it is an unique and easily tracked MID. To utilise this macro yourself create a directory to hold all your macros, change to this appropriate directory and download the macro:

mkdir -pv $HOME/News/macros/
cd $HOME/News/macros
wget http://slrn.sourceforge.net/macros/create_msg_id.sl

You will need to alter two variables to show your subdomain and domain and then add the following lines to $HOME/.slrnrc:

set macro_directory "News/macros"
interpret "create_msg_id.sl"

And the macro is now installed and ready to use. A similar procedure will launch any macro you chose to use and may even encourage you at some stage to start writing your own.

Utilising scoring

I would encourage anybody who is interested in scoring under slrn to consult the two seminal documents: score.text and Section 4 of the FAQs. To start scoring under slrn first create the file $HOME/News/Score and then place the following lines in the ~/.slrnrc file:

% Name and location of the score file
set scorefile "News/Score"

The idea is that you can score from -9999 to 9999 based on news overview data (Subject, From, Date, Message-ID, References, Bytes and Lines) utilising some deceptively simple rules. This is done to ensure that posts more interesting to you will have a higher priority while posts that are of no interest can either be ranked low or hidden from view completely. The following is a 'key' to the scoring system that may be placed at the top of your scorefile for guidance:

%% Key for Score Settings %%

%  :    Logical AND ie all tests must be passed (Conjunction)
%  ::   Logical OR ie any of the tests are passed (Disjunction)
%  ~    Logical NOT ie an exception from the score rule (Negation)
%  =    Stop score processing and award the score if the test is passed
%  *    Wild card character

Some experimentation will be in order before your own scorefile meets your needs exactly and I would advise reading the two documents previously mentioned very carefully and taking any queries to the home of slrn: news.software.readers.

Installing slrn 1.0.1

December 21st 2012 saw the release of the newest version of slrn: 1.0.1 and it is recommended that usenet enthusiasts install the newest version. You can easily compile your own by following the following directions. Both compiling and subversion tools will be needed as well as the required S-Lang library:

sudo apt-get install build-essential git libslang2-dev checkinstall

With these files in place the slrn 1.0.1 can be downloaded and compiled as follows:

mkdir $HOME/slrn_build && cd $HOME/slrn_build
wget http://www.jedsoft.org/slrn/download/slrn-1.0.1.tar.gz
tar xzvf slrn-1.0.1.tar.gz
cd slrn-1.0.1
./configure --with-slrnpull --enable-setgid-code --with-slang=/lib/*-linux-gnu
make
sudo checkinstall --pakdir "$HOME/slrn_build" --backup=no --deldoc=yes \
                  --pkgname slrn --pkgversion "1.0.1" --fstrans=no \
                  --deldesc=yes --delspec=yes --default

And this will give you a copy of the latest slrn!

External Links


CategorySoftware

slrn (last edited 2013-03-03 07:14:30 by andrew.46)