Setting up the newsreader slrn under Linux
slrn is the creation of John E. Davis (JED) and was first made available in 1994. It was written partly because of JED's dissatisfaction with the relatively sluggish performance of gnus/emacs as well as a general dissatisfaction with other newsreaders such as tin, nn, rn and others. JED also wanted to write software that would utilise his new screen management routines for the slang library and finally wanted to write a newsreader for his girlfriend to use on a VMS platform. From these various threads slrn was created. But what is slrn?
slrn ('S-Lang read news') is a newsreader, i.e. a program that accesses a newsserver to read messages from the Internet News service (also known as 'Usenet'). It runs in console mode on various Unix-like systems (including Linux), 32-bit Windows, OS/2, BeOS and VMS. Beside the usual features of a newsreader slrn 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. Offline reading is possible by using either slrnpull (shipped with slrn) or a local newsserver (like leafnode or INN).
This page describes one method of setting up this newsreader for Linux. It is deliberately not focused on any particular Linux distro and consequently may need some adjustment according to whether Debian, Ubuntu, Slackware etc is used. Please use the email link at the base of this page to pass your thoughts on to me. And remember: Have fun!
First Some Preparation ...
slrn is a newsreader that encourages some careful preparation before installation. At the very least this preparation should consist of ensuring that your system has an unique Fully Qualified Domain Name (FQDN) and that several Environmental Variables have been set:
Setting an Unique Fully Qualified Domain Name
I would advise a few moments of careful thought to ensuring that your system has an unique Fully Qualified Domain Name (FQDN). On most systems this can be seen by running hostname --fqdn. If this is not set correctly the Message-IDs (MIDs) that slrn generate may cause some comment and more importantly there is the possibility of newsgroup posts with the same Message-IDs colliding. There are three good choices here:
- If you legitimately own your own Domain Name use this in conjunction with a subdomain and the hostname of your computer.
- Use a service such as dyndns.org which will give you a domain name for free with the bonus of a Dynamic DNS service.
- Use the news service individual.net which will give you a FQDN with your €10 membership.
If slrn is to generate your Message-IDs (MIDs) the formula is a string consisting of "slrn", time, process id, user and hostname so it is advisable to set your FQDN accurately. The method of setting the FQDN will vary a little according to the Linux distro that is being used but it is a sound investment of time and effort and will leave your system the better for being properly configured.
Some Environmental Variables
There are a few Environmental Variables that should be set when using sln and a couple that will simply make your life with slrn a little easier. I have the following set in my own ~/.bashrc:
# -- Recommended slrn ~/.bashrc settings --- NNTPSERVER=newsserver && export NNTPSERVER ORGANIZATION='slrn Mafia' && export ORGANIZATION EDITOR=/usr/bin/vim && export EDITOR
Of course you will need to put the name of your news server in the NNTPSERVER section, and decide on your EDITOR and the path to it. And of course you will have to qualify for membership to the slrn Mafia before placing the ORGANIZATION environmental variable! I will discuss these settings further as they come up in our installation of slrn.
Download, Compile & Install slrn
September 27th, 2008 saw the release of slrn 0.9.9p1 and it is strongly advised that you use this version. You will of course also need compiling tools and the development files for S-Lang that are appropriate for your distro. The following downloads the source code of the latest "release" version of slrn and compiles it.
$ cd $HOME $ wget ftp://space.mit.edu/pub/davis/slrn/slrn-0.9.9p1.tar.gz $ tar xzvf slrn-0.9.9p1.tar.gz $ cd slrn-0.9.9p1 $ ./configure $ make $ su # make install
This will install a basic copy of slrn, and certainly this is as much as I do for my own use. But if you run ./configure --help you will see several other options that may interest you, such as the option of utilising slrnpull for offline reading, compiling in support for canlock to allow you to cancel your own posts, using ssl to encrypt your connection and a few other options.
Setup .slrnrc
Next step is to set the configuration file for slrn. There are several ways to go about this but the easiest is to copy the sample slrn configuration file that comes with the slrn source code into $HOME/.slrnrc. The exact location of the sample file will depend on your installation path of course,so it might perhaps be easier to copy the file from the svn source code:
$ cp $HOME/slrn-0.9.9/doc/slrn.rc $HOME/.slrnrc
Linux dot files can consume an immense time in research and testing so Gentle Reader I have taken the liberty of suggesting a few basic settings below. This brief listing is by no means comprehensive, it is simply intended to furnish a starting point.
%------------------------------------------ % Section 1: Tell slrn about your identity. %------------------------------------------ % Basic identification information which creates: % From: Skywalker <luke@deathstar.invalid> set username "luke" set hostname "deathstar.invalid" set realname "Skywalker" % Also create a real email address that is less likely % to be spammed. Use gmail anyway to be sure: set replyto "luke.skywalker@gmail.com" %------------------------------------------ % Section 2: Server specific settings. %------------------------------------------ % Allows slrn to pass username and password to newsserver if % such authentication is required: nnrpaccess "newsserver" "username" "" %------------------------------------------ % Section 3: External programs. %------------------------------------------ % Sets the external editor. set editor_command "vim '+set tw=70' +%d '%s'" % Sets Firefox for X and w3m for console only: set Xbrowser "firefox '%s' &" set non_Xbrowser "w3m '%s'"
You will see for the settings for nnrpaccess I have left the password setting as "". This means that slrn will prompt you for the password each time you log on. If you place your password here instead remember to change the permissions of the file to 0600. Don't forget as well to place details of your news server here. You will see as well that vim has been selected as editor, not only here but also we have set it previously as $EDITOR. Feel free to select another editor, as long as it is vim!
Colors are dealt with in section 9 of the .slrnrc file and can be a little daunting at first sight. Below is a quick guide to these color choices that I have at the top of my own section 9:
%--------------------------------- % 9. Display / color settings %--------------------------------- %--- normal --------- bold --------- % 0 black 8 gray % 1 red 9 brightred % 2 green 10 brightgreen % 3 brown 11 yellow % 4 blue 12 brightblue % 5 magenta 13 brightmagenta % 6 cyan 14 brightcyan % 7 lightgray 15 white
You will need to experiment a little with these colors as color rendition can vary from terminal to terminal and is not controlled by either slrn or s-lang. If you are feeling a little more venturesome read further and I will describe how to use an slrn macro to interactively change these colors
That completes the most basic look at this configuration file and I encourage you to examine this file in much greater detail in the near future. Now to complete the slrn installation with a brief examination of scoring and the use of macros:
Completing the slrn Installation
There are two remaining areas to consider before it can be said that slrn has been properly setup. I speak of the scoring system and the use of macros to extend the functionality of slrn. First to have a quick look at scoring:
Scoring in slrn
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 $HOME/.slrnrc file.
% Name and location of the score file set scorefile "News/Score"
The basic 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 I have produced which may be placed at the top of your scorefile.
%% 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
The following brief scorefile is in three sections and demonstrates scoring of my own posts, a "killfile" and scoring of a single newsgroup:
% ------------------ Sample slrn scorefile ----------------- [*] Score: 500 % Posted by me From: Skywalker <luke@deathstar\.invalid> Score: 500 % Replies to my posts References: \.luke@ID\-1234567\.user\.individual\.net> % Global Killfile Score:: =-9999 Subject: Nike From: Foolish Frank Message-ID: \.spamnest\.com> [news.software.readers] Score: 500 % My favourite subject Subject: slrn Score: =-9999 % A conditional killfile Expires: 1-8-2008 Subject: gnus is cool ~From: JED
It is all fairly straightforward and many more examples are available in the documents quoted at the beginning of this section. This simple scorefile promotes my own posts and also replies to my posts in all newsgroups. There is also a killfile that operates on all groups screening various people, subjects and MIDs disagreeable to me. The final example for news.software.readers promotes any mention of slrn in the subjext and also killfiles a boring discussion on gnus unless JED posts on the subject with the rule expiring on August 1st 2008. This is a very simple demonstration but the possibilities are endless!
Using Macros in slrn
The use of macros can enormously extend the power of slrn and there are a handful included with slrn. To show how this works we will set the macro color.sl which allows dynamic changing of slrn colors. First place the following in $HOME/.slrnrc:
% Loads the colour editing macro and assigns Esc e c interpret "color.sl" setkey article edit_colors "\eec"
Start slrn and press the key combination ESC e c and you can now interactively change your colors. You can specify a different key binding for the macro but be careful not to double up as results might be a little unpredictable! Several other macros are included with slrn and a host more available for download from external sources.
A very nice example of such a macro from an external source is the create_msg_id.sl macro developed by Troy Piggins. I use this myself and on my system it creates a Message-ID in the format:
Message-ID: <20080426081643.549@ilium.andrews-corner.org>
Which is of course yyyymmddhhmmss followed by three random characters and finally subdomain and domain. How cool is that? 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://piggo.com/~troy/pub/linux/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 there you have it! I would strongly encourage you to do what I have not done myself and spend the time learning to create such macros, and of course send a quick email to say "thanks" to the authors of these macros, which I have done! But now to fire up slrn:
Running the program
Finally the time has come to actually use slrn! slrn first needs to download a list of newsgroups from your news server and write the file $HOME/.jnewsrc The optional slrn -d also downloads a list of newsgroup descriptions, nice but not mandatory. SInce we have already have $NNTPSERVER defined the following commands are all that is required:
$ slrn --create $ slrn -d
And now open up slrn, subscribe to a few groups and start spreading your wisdom around. I would strongly suggest news.software.readers where most of the slrn mafia can be found as well as alt.test where nobody really cares about any initial blundering around with slrn! And don't forget to set $ORGANIZATION to "slrn Mafia" when you are ready to join the club.
And in conclusion...
Writing this page has been a fascinating journey into the world of slrn and I owe a huge amount to the newsgroup news.software.readers and to the slrn-user mailing list. And of course the greatest thanks to JED who has put so much time and effort into giving slrn a new direction and focus. Please contact me with any errors of fact that you have found, any errors of opinion will probably remain uncorrected. In the meantime I am having a great time exploring slrn and Usenet, what about you?