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 |
Recent releases


No changes have been submitted for this release.


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.


No changes have been submitted for this release.


No changes have been submitted for this release.


Changes: This release fixes a tiny but show stopping bug in one of the shell scripts.
- All comments
Recent commentsUse 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 :)
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.
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=""
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
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.