sn

sn is a small news system for sites which serve perhaps a few dozen newsgroups, and which have a slow connection to the Internet. The target user is a home or SOHO with a single modem connection to the Internet and serving a few workstations. sn also includes a mail-to-news filter.

Tags Communications Usenet News Email Filters
Licenses GPL
Operating Systems POSIX Linux
Implementation C

Tweet this project Short link

Rss Recent releases

  • Rrelease-mid
  •  10 Aug 2004 09:48
  • Rrelease-after

No changes have been submitted for this release.

  • Rrelease-mid
  •  26 Apr 2004 15:45
  • Rrelease-after

Changes: A few binaries have been renamed to avoid conflicts with other packages. A segfault on PPC Linux systems has been fixed. A contrib directory has been added for contributed tools/examples. There are some small bugfixes.

  • Rrelease-mid
  •  20 Jan 2003 17:00
  • Rrelease-after

No changes have been submitted for this release.

  • Rrelease-mid
  •  06 Jul 2002 14:46
  • Rrelease-after

No changes have been submitted for this release.

  • Rrelease-mid
  •  13 Nov 2001 17:34
  • Rrelease-after

Changes: This release fixes a tiny but show stopping bug in one of the shell scripts.

Rss Recent comments

Rcomment-before 03 May 2003 08:27 Rcomment-trans patrikr Rcomment-after

Use the mailing list
Please, if you have patches or other enhancements that you want to submit to sn, send them to the mailing list. This forum is not the right place for them.

Signed,
the maintainer :)

Rcomment-before 02 May 2003 12:54 Rcomment-trans DominicB Rcomment-after

Re: username/password authentication
Ok, this is not, what I expected to happen ;-)

The pre-commands are stripped. See sourcecode of html page for the original diff file.

Rcomment-before 02 May 2003 12:51 Rcomment-trans DominicB Rcomment-after

Re: username/password authentication
This should fix some problems:

--- nntp.sh.old 2003-05-02 21:31:21.000000000 +0200
+++ nntp.sh.new 2003-05-02 21:36:02.000000000 +0200
@@ -42,5 +42,5 @@
}

-echo "200 Hi, you can post (sn simple auth script)"
+printf "200 Hi, you can post (sn simple auth script)\r\n"

@@ -59,11 +59,17 @@
#switchpart=`echo ${currentline:0:14} | tr [:lower:] [:upper:]`
case "$switchpart" in
- "LIST EXTENSION")
+ "LIST EXTENSIONS")

- echo "202-Extensions supported:"
- echo " AUTHINFO USER"
- echo "."
+ printf "202-Extensions supported:\r\n"
+ printf " AUTHINFO USER\r\n"
+ printf " MODE READER\r\n"
+ printf ".\r\n"
haveuser=""
;;
+ "MODE READER")
+ # some newsreaders (e.g. MacSoup ;-))
+ # send this command at the very beginning
+ printf "200 You are already in this mode. Ignored.\r\n"
+ ;;
"QUIT")

@@ -73,5 +79,5 @@
# extract username
haveuser=${currentline:14}
- echo "381 Continue with authorization sequence"
+ printf "381 Continue with authorization sequence\r\n"

# echo $haveuser
@@ -84,10 +90,10 @@

if checkuser $haveuser $havepass ; then
- echo "281 Authorization accepted"
+ printf "281 Authorization accepted\r\n"
export POSTING_OK=1 # is this necessary?

exec $SNNTPD -S logger -p news.info
else
- echo "482 Authorization rejected $msg"
+ printf "482 Authorization rejected $msg\r\n"
fi

@@ -95,5 +101,5 @@
;;
*)
- echo "450 Authorization required for this command"
+ printf "450 Authorization required for this command\r\n"
haveuser=""

Rcomment-before 19 Feb 2003 02:32 Rcomment-trans johill Rcomment-after

username/password authentication

The sn documentation tells you to use another script for it. Since we found none, we wrote our own, which I'll put here for everyone's convenience.

#!/bin/bash

# simple script for doing authentication with sn, 

# the usernames and passwords are defined inline

# in this file

# settings

timeout=20  # seconds!

SNNTPD=/usr/sbin/snntpd 

#users (array)

users=(user1 user2 user3)

#corresponding passwords (must not be shorter than users array!)

passwords=(password1 password2 password3)

# end settings

checkuser () { 

  user_count=${#users[@]}

  index=0

  while [ "$index" -lt "$user_count" ] ; do

    if [ "${users[$index]}" = "$1" ] ; then

      if [ "${passwords[$index]}" = "$2" ] ; then

        return 0

      else

        return 1

      fi

    fi

    let "index = $index + 1"

  done

  return 1

}

echo "200 Hi, you can post (sn simple auth script)"

haveuser="" # no one yet

# simple loop as long as no timeout or other read error occurs

# loop also terminates when exec()'ing snntpd, for obvious reasons

while read -t $timeout currentline ; do

  lenm1=`expr ${#currentline} - 1`

  currentline=${currentline:0:$lenm1}

  switchpart=`echo ${currentline:0:14} | tr [a-z] [A-Z]`

  #switchpart=`echo ${currentline:0:14} | tr [:lower:] [:upper:]`

  case "$switchpart" in

    "LIST EXTENSION")

      echo "202-Extensions supported:"

      echo " AUTHINFO USER"

      echo "."

      haveuser=""

    ;;

    "QUIT")

      exit 0

    ;;

    "AUTHINFO USER")

      # extract username

      haveuser=${currentline:14}

      echo "381 Continue with authorization sequence"

      #      echo $haveuser

    ;;

    "AUTHINFO PASS")

      # check password

      havepass=${currentline:14} # extract password

      if checkuser $haveuser $havepass ; then

        echo "281 Authorization accepted"

        export POSTING_OK=1 # is this necessary?

        exec $SNNTPD -S logger -p news.info

      else

        echo "482 Authorization rejected $msg"

      fi

      haveuser=""

    ;;

    *)

      echo "450 Authorization required for this command"

      haveuser=""

    ;;

  esac

done

Rcomment-before 17 Dec 2001 09:34 Rcomment-trans blades Rcomment-after

rpms
RPM link wrongly leads to binary rpms and the only srpm is a very old version.
I'll just keep looking or repackage it myself.

1943c1d594db90ddfb1b02d2403fa570_thumb

Project Spotlight

JMeld

A visual diff and merge tool.

372562d2c5048f5f004813246f937000_thumb

Project Spotlight

XWelltris

A 2.5D Tetris-like game.