============
Introduction
============
This 'Howto' page demonstrates how to setup the great console newsreader slrn under Ubuntu Linux and deals with the 'release' version slrn 0.9.9. Setting up slrn requires a little preparation as it deals with not just slrn but a few 'companion' programs as well.
But first some preparation work:
====================
Set a FQDN
====================
For the best setup you should have an unique Fully Qualified Domain Name (FQDN) set to your system. Check this with the following command:
If this is not set you will need to alter your /etc/hosts file to reflect your FQDN. The default Ubuntu /etc/hosts file tends to look something like this:
Code:
127.0.0.1 localhost
127.0.1.1 desktop
Alter this to something like:
Code:
127.0.0.1 localhost
127.0.1.1 desktop.your.domain desktop
(Thanks to PJR for the information above). For your own, unique FQDN you have 3 good choices:
- If you 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.
- Use the news service individual.net which will give you a free FQDN.
A word of warning: an incorrect or false FQDN might expose you to merciless flaming so spend a little time getting this set correctly. Next we set up the text editor vim and the then Mail Transport Agent (MTA) msmtp:
========================
Getting Acquainted with vim
========================
slrn does not come with a built-in editor and the best editor to use with slrn is vim, although many will argue this point. A version of vim comes as part of the default Ubuntu installation but before launching into this reasonably complex program I would advise you to run through vim's tutorial program which can be launched with the following command:
A skill with vim is not the mandatory part of a Linux experience that it once was but you will find skills in vim will be very useful to you in other areas. Next to set up our MTA:
=================
Setting up an MTA
=================
To reply by email to a news posting sendmail or a substitute is required and in this 'Howto' msmtp will be used. To reply by email rather than post directly to the newsgroup is not often appropriate but it has its uses. The following command downloads and installs msmtp + a certs pack:
Code:
$ sudo apt-get install msmtp ca-certificates
This very simple program needs a single configuration file to be created, a logfile to be created, an addition made to the ~/.slrnrc file, and then it will happily send email from within slrn:
Code:
$ touch $HOME/.msmtprc
$ touch $HOME/.msmtp.log
$ chmod 0600 $HOME/.msmtprc
Below is the required configuration for a Gmail server:
Code:
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
With both vim and msmtp setup it is time to move on to slrn itself:
==========================
Download slrn
==========================
Times have changed with the new release of slrn and finally users of Jaunty Jackalope can get a perfectly usable version direct from the Ubuntu repository:
Code:
$ sudo apt-get install slrn
Previous versions of Ubuntu are not so fortunate but Thomas Wiegner has been good enough to make Ubuntu packages of the latest slrn available from his site: slrn patches and ubuntu repository/packages. These packages can either be downloaded and installed directly from his site or can be accessed by adding either of the following lines to /etc/apt/sources.list:
Gutsy Gibbon:
Code:
deb http://www.foory.de/thw/slrn/ gutsy/
Hardy Heron:
Code:
deb http://www.foory.de/thw/slrn/ hardy/
Intrepid Ibex:
Code:
deb http://www.foory.de/thw/slrn/ intrepid/
Use of the repositories should guarantee that slrn will be kept up to date via the Ubuntu package management system.
But now to setup the file ~/.slrnrc:
===============
Setup ~/.slrnrc
===============
slrn requires the creation of a personal configuration file: ~/.slrnrc. The following commands transfer a sample file from the slrn website to its correct location and opens it for editing:
Code:
$ wget http://slrn.sourceforge.net/downloads/slrn.rc -O $HOME/.slrnrc
$ vim $HOME/.slrnrc
May I suggest a very few basic settings to make your early days a little easier?
===========================
Some Suggested ~./slrnrc Settings
===========================
There are 11 sections, not all of which need to be altered simply to get slrn successfully online. You can see that this file uses the figure % to create a comment, simply remove the % to allow slrn to see and perform the command.
Section 1: Tell slrn about your identity. These following fields will usually need to be un-commented and set:
Code:
% 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"
% Set the location of your signature:
set signature ".signature"
Don't forget to create the signature as follows:
Be prepared observe a little netiquette with your signature file or you will meet some serious flame action. You do not have to add the usual signature delineator "-- " as slrn will do this for you automatically.
Section 3: Which external programs do you want to use? It is in this section that we will set vim as the default editor with the following line:
Code:
% Sets vim to edit with 72 character width.
set editor_command "vim '+set tw=72' +%d '%s'
This also sets the messages to be 72 characters wide which will save you from the wrath of other newsgroup readers. While you are here you may as well set Firefox as your default browser:
Code:
% Sets Firefox as default browser.
set Xbrowser "firefox '%s' &"
If you are keen to really come to grips with the console you could download the w3m browser and set it in your ~/.slrnrc file as well. Don't forget that you can call up URLs from within your news messages by typing in "U".
Next for the appropriate lines to tell slrn to use our MTA msmtp:
Code:
% Sets msmtp rather than sendmail.
set sendmail_command "/usr/bin/msmtp -t"
So now you can forward messages to outside addresses by typing in "F" and reply to the given email addresses of newsgroup posters by typing "r". Don't forget to observe a little netiquette: it is almost always better to reply to the group rather than email the poster directly.
Section 8: Some preferences for the article pager. Since you have gone to some trouble to set up a decent news reader it is nice to see newsreader other people are using. Un-comment the following line and add in User-Agent:
Code:
% Sets the default headers you see above messages.
visible_headers "From:,Subject:,Newsgroups:,Followup-To:,Reply-To:,User-Agent:"
Remember when you you are reading messages you can toggle full headers and the shorter listing by pressing a lower case "t". For the sake of completion you should add X-Newsreader, X-Mailer and X-Posting-Agent as well as User-Agent.
Section 9: Display / color settings. Don't alter these settings yet until you have had a look at the default slrn colours but come back later and alter the colours in the section marked:
Code:
% These settings are used for color terminals:
There will be 2 colours set for most elements, the first is foreground the second is background. You can add a third option to the right of these values: bold, blink, underline and reverse. Experiment a little. You can also ask for "default" which will use the default settings of your Terminal program. A basic guide for these colors that can be placed in your ./slrnrc file for easy reference is:
Code:
%--- 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
This completes the basic setup of your ~/.slrnrc file but I am sure you will be back to make many, many changes. If you are interested there are a couple of extra settings at the base of this page. The next task is to setup the news server in your computer's environment variables:
==============================
Setting the NNTP Environment Variable
==============================
slrn needs to know where your news server is. To do this you will need to set set the environment variable "NNTPSERVER" to the hostname of your preferred newsserver. Open the file ~/.bashrc as follows:
and add the following lines, substituting 'your news server' with the actual address of your news server, leaving the apostrophes in place:
Code:
# Sets the News Server Environment as required by slrn
NNTPSERVER='my.news.server' && export NNTPSERVER
A few more steps and then slrn can be run for the first time:
==================
Running the program
==================
slrn needs to download a list of newsgroups from your news server, setup the file ~/.jnewsrc and optionally download a list of newsgroup descriptions. Open a Terminal window and type the following:
Code:
$ slrn --create
$ slrn -d
Congratulate yourself a little and type the next simple command into a Terminal window: slrn and yes, you have successfully 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 in conclusion
===============
Be prepared for a steep learning curve but when you have mastered the basics of the program I predict you will never return to a GUI newsreader. If you get tangled up a little: close the program down, have a cup of tea, and read the slrn manual online. Perhaps you would like to use the NNTP proxy server Leafnode-2 with slrn as I do? Try another guide I have written on these forums: [Howto] Setup and use Leafnode-2 with the newsreader slrn.
April 13th, 2009
Andrew Strong
Bookmarks