Fighting Grey Hairs and Insanity

“Scrambled Musings and Diffused Chaotic Wisdom From My Twisted Mind…”

SLRN Howto

without comments

Setting up SLRN on Slackware Linux

last updated on: 2007/02/07

The Goal: Setting up the slrn newsreader on Slackware.

Quick Index:

Introduction

What is slrn? Slrn is a usenet 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). 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 leafnode or INN.

Why srln?

Above all it’s command line. I can log in remotely from anywhere and still read my news. I can keep my news session open through screen and restart KDE without loosing where I was. It’s convenient. It doesn’t hog the system resources. And perhaps, maybe a bit .. it’s just different. I have used different newsreaders over the years, Outlook Express in my windows days, Knode till quite recently. I had a look some time ago at slrn. And I couldn’t crack it.

So I decided this time it was going to be different. It was gonna work and I was gonna document it. (after all, if you fail, make sure that everyone can see it)

What do you need

  • A working installation of slackware with slrn installed
  • a knowledge of linux and slackware (including the usage of editors)
  • a knowledge of the newsserver you want to use (including possible login credentials)

How to get it all working:

Slrn makes use of the following files:$HOME/.slrnrc (the User-specific configuration file) and $HOME/.jnewsrc (the default newsrc file for slrn). Also you need to have the NNTPSERVER enviroment variable set.

1. The NNTPSERVER variable.

To begin with the NNTPSERVER enviroment variable. Slackware cotains a system-wide configuration file called /etc/nntpserver. If you want to use just one news server for all your users you can easily set your nntp server here. Please note, that this can be overridden by users setting the NNTPSERVER enviroment variable in one of their login files.I have chosen to put mine into my $HOME/.bashrc.[1]

Simple add the following code to your login-files-of-your-choice.

NNTPSERVER=news.server.net
export NNTPSERVER

If you set your news server in your loginfile, you may want to log-out and log-in again/source your loginfiles or run the export NNTPSERVER=new.server.net on the CLI to make sure slrn knows it is using the correct server.

2. Setup $HOME/.slrnrc

As already pointed out slrn looks for a configuarion file in $HOME/.slrnrc: Slackware includes a standard file in /etc/slrn.rc. So the first step is, that we need to copy this file into our home directory.

cp /etc/slrn.rc $HOME/.slrnrc

Note: a second copy of slrn.rc is stored in /usr/doc/slrn- -0.9.8.1/slrn.rc. Now the next step is to edit the .slrnrc file and put in the needed options. The .slrnrc configuration file consist out of a total of 11 different sections and is quite well documented. Any lines prefixed with “%” are considered a comment. Taking you through the most important parts:

*note*: I strongly recommend that you take the below tips as hints only. These are just the bare mimium settings I think you should be aware off. Slrn is quite well documented and has a whole bunch of settings which are beyond the scope of this HowTo.

Section 1: Personal information
To set your own name find the following lines (lines 15-17) and replace them with your username/emailid, domain name and your realname
set username “john”
set hostname “doe.com”
set realname “John Doe”

If you want to have your postings suffixed with a signature (which could contain your contact information or perhaps some ultra-witty saying; uncomment the following on line 27:
signature “.signature”

Section 2: Server specific Settings
Slrn can deal with multiple servers. Each server has its own $HOME/.jnewsrc file and comes in the below format:
server “news.doe.com” “.jnewsrc-doe”

This is only needed if you have more than one server. This is also only needed for extra servers, as this doesn’t set the default NNTPSERVER and the default .jnewsrc file.

If your news server requires some way off authentication and face it, most do nowadays, although there are a few free ones out there, you have to uncomment line 40. (as shown below). Put each server you acquire access to on it’s own seperate line:
nnrpacces “news.doe.com” “john” “secret”

You can also have slrn prompt you for the various credentials;
nnrpacces “news.doe.com” “john” “” Prompt for password.
nnrpacces “>news.doe.com” “” “” Prompt for username and password.

Sometimes servers require authentication, but won’t directly ask for it. You can “force” to send your authenticaion to the server by setting line 44 as below:
set force_authentication 1

section 3: External Programs
Under external programs you can among others configure what browser you want slrn to use as well as which editor. Standard slrn under slackware seems to default to the vi-editor. Which is fine, but if you want something more fancy, with nice spiffy colors (you know you want to!), you might consider switching to either jed or vim.

My preference runs for vim. So set your editor, change line 91 to the following: (both examples for sed and vim given):
set editor_command “jed ‘%s’ -g %d -tmp”
set editor_command “vim +%d ‘%s’

Another feature that could be quite handy, is for slrn to abort any postings if we haven’t modified the actuall posting. So atleast we can’t do any reposts without saying anything remotely intteligent. Change the value of line 100 to anything other than “0″.
set abort_unmodified_edits 1

section 4: Directory and filenames
If you are like me and like to keep copies of the things you send out, you need to uncoment some of the settings in this section. It seems that slrn prefers the directory $HOME/News which is actually quite fine by me considering that mutt seems to prefer
$HOME/Mail
.

I find it confusing the way slrn wants to keep replies and your own post seperate. I like them nicely togethe. Especially considering the fact that I am probably slightly more active on my own threats ;)
set save_posts “News/send”
set save_replies “News/send”

If you want to keep failed post around, slrn will save these in a file called dead.letter. Failed posts are appended to this file. Use “” to disable saving. I prefer to keep everything tightly together. So I am putting the dead.letter in News/ as well
set failed_posts_file “News/dead.etter”

If you want to use a Scorefile you can choose here where the location of this file is:
set scorefile “News/scorefile”

Directory where all other files are saved. I might changes this to $HOME/downloads. I have to think about it.
set save_directory “News”

Directory where postponed articles are placed. Please make sure it exists.
set postpone_directory “News/postponed”

section 6. Character mapping / MIME supportsection
% If non-zero, call metamail for MIME formats slrn cannot handle.
set use_metamail 1

section 7. Preferences for the header section

Slrn can do automatic sorting of the thread. It’s pretty good documentated. I prefer my news to be threated and sorted by date so I can quickly see what is new:
set sorting_method 11

9. Display / color settings

In xterm settings if you want mouse support, you need to enable it in your configuration. Below is the line to enable mousesupport.
set mouse 1

If you want slrn to draw a bar that highlights the post you are looking at, instead of slrn “->” cursor? Then set the below line (line 250) to:
set display_cursor_bar 1

I am leaving some sections of of the .slrn config out of this howto. Basically because colors and keybindings are a more personal setting and anyone has their own way of setting things up. As Slrn is pretty popular, there are plenty of sample configurations that can show you how to make your .slrnrc just shine with pure magic :)

With all this done, this makes the configuration of the .slrnrc file complete and we can close it and go on to the next step.


3. Setup $HOME/.jnewsrc

The next step is setting up the $HOME/.jnewsrc file. The .jnewsrc file is the default file for the news server specified in the NNTPSERVER variable. If you have more than one server specified in your slrn config file they should have the prefix of the servers domain name (see section 2.1 The command to generate the standard jnewsrc file is:

slrn -f ~/.jnewsrc --create

This will connect to the newsserver specified in NNTPSERVER and writes the .jnewsrc file with a list of all available newsgroups on that particular server. In case you also want to see the description of all available newsgroups (when present and which may take some time)

slrn -d

Note that you cannot run the “-d” switch in combination with slrn --create. After slrn -d has downloaded all the descriptions from the server, slrn will exit to the prompt. Next time you start, slrn will show the descriptions of the newsgroup (only if you have set up your srln to display group header (see group_display_format in your slrn manual) for this.

If you have the neeed more then one server, you need to perform a couple of extra steps. First of all; we need to edit .slrnrc. Look for the line named (this should be around line 37):
%server “news.doe.com” “.jnewsrc-doe”
and change that into
server “beta.teranews.com” “/jnewsrc-tera”

This will make it possible for slrn to combine which news server and which .jnewsrc file belong with each other. Once you have changed that line, save and exit your .slrnrc. The next step is to create the .jnewsrc file for the new server but give it a new -prefix. Also you have to specify the server with the -h (for host) option

For example: if you want to connect to the beta.teranews.com server, give the following command:

slrn -h beta.teranews.com -f ~/.jnewsrc-tera -- create

Now if you want to use srln with the new server (or any other server different from the one set with NNTPSERVER. just start slrn with:

slrn -h beta.teranews.com

slrn will automatically find the right files for this.


4. Running slrn

From that moment, you are already inside slrn and start selecting your default newsgroups.You can search on newsgroups by pressing “/” and subscribe to new groups by pressing “s”. At start slrn will asume you want to unsubscribe pretty much all of the newsgroups the server offeres except some test groups. Keep at least one around for testing changes in your slrn config and getting to grips with slrn.

At first slrn may seem a bit weird to you, or perhaps even counter intuitive, but you soon get to grips with it. One of the things I found out that slrn seems to take reply and follow up somewhat different that I am used to.

Reply: reply to the poster of the newsgroup article – this is a reply by email and will not show on the grouplist
Followup: Post a message to the newsgroup in response to a newsgroup article

I’ll try and update the list of standard keybindings:


7. Todo

- have to do some better research in how slrn works. This howto was written as I went along.
- Better understand intergration between vim and slrn
- understand score files
- Make more of this howto :)


8. footnotes:
[1]: My .bashrc gets sourced regarded of my login shell. See `man 1 bash` and especially the invocation part.

9: slrn config examples

http://alcor.concordia.ca/topics/netnews/slrn/doc/slrnrc.html

http://www.preater.com/apps/slrn/slrnrc.html

http://nion.modprobe.de/setup/slrnrc

Written by Michiel

7 February 2007 at 8:40 pm

Leave a Reply