个人工具

UbuntuHelp:Slrn

来自Ubuntu中文

Wikibot讨论 | 贡献2009年11月17日 (二) 20:37的版本 (创建新页面为 '{{From|https://help.ubuntu.com/community/slrn}} {{Languages|UbuntuHelp:slrn}} ''This page has drawn heavily from information contained on the [http://slrn.sourceforge.net/ slrn ...')

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索

This page has drawn heavily from information contained on the slrn website and the Ubuntu Forums slrn guide. Thanks to the authors of both of these 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 [email protected] 
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.

Install slrn

Ubuntu is fortunate in that for the most part modern versions of slrn are included in the repositories from Intrepid 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

or a more updated configuration file can be downloaded directly from the slrn website in this manner:

wget http://slrn.sourceforge.net/downloads/slrn.rc -O $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  "[email protected]"

% 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?

Installing the svn slrn

Jaunty Jackalope and Karmic Koala feature reasonably modern versions of slrn but for those who have a hunger for the cutting edge it is possible to run the development version of slrn by accessing its subversion repository. Both compiling and subversion tools will be needed as well as the required S-Lang library:

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

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

svn co https://slrn.svn.sourceforge.net/svnroot/slrn/trunk slrn
cd slrn
./configure
make
sudo checkinstall --install=yes --fstrans=no

The installation can be subsequently updated by changing to the source code directory, running svn up and recompiling. There is of course absolutely no guarantee that this code will be stable and of course this is half the fun!

External Links

  • Home of the slrn newsreader This is the main website of the newsreader slrn. It was redesigned and rebuilt for the release of slrn 0.9.9 in 2008.
  • Documentation for the slrn newsreader All the documentation for the slrn newsreader can be found here including the manual, FAQs, a sample configuration file and much more.
  • Slrn-user -- discussion about the slrn newsreader The slrn-user mailing list is open for discussion of the use, development and extension of the slrn newsreader.
  • [Howto Setup and use Leafnode-2 with the newsreader slrn] Get the most out of your copy of slrn by using it in conjunction with the proxy NNTP server Leafnode 2.
  • slrn patches and ubuntu repository/packages Thomas Wiegner's page of slrn patches and details of his slrn packages and repositories for Feisty, Gutsy, Hardy and Intrepid.