🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
10 messages
10 total messages Started by John Kenickney Mon, 09 Aug 2004 12:15
NNTP server test script
#69689
Author: John Kenickney
Date: Mon, 09 Aug 2004 12:15
7 lines
1221 bytes
I want to test free nntp servers that I find on the internet. Mostly the
reports are not correct; they don't exist anymore or they don't allow
posting anymore... It's a time consuming job to do that by hand with an
ordinary news reader. Is there a script or program that tests whether a
server allows posting or at least tries to post a test message?

Re: NNTP server test script
#69680
Author: Hans
Date: Mon, 09 Aug 2004 13:17
14 lines
1582 bytes
On Mon, 9 Aug 2004 14:15:53 +0200, "John Kenickney"
<spam.trap@bigfoot.com> wrote:

>I want to test free nntp servers that I find on the internet. Mostly the
>reports are not correct; they don't exist anymore or they don't allow
>posting anymore... It's a time consuming job to do that by hand with an
>ordinary news reader. Is there a script or program that tests whether a
>server allows posting or at least tries to post a test message?

We should create an private mailinglist to swap info about open/free
servers. Much easier. Almost every weblist is 'outdated' (another word
for 'totally useless').

Hans
Re: NNTP server test script
#69681
Author: John Kenickney
Date: Mon, 09 Aug 2004 14:12
19 lines
1861 bytes
"Hans" <nospaminmijnbox@pfcorner.nl> schreef in bericht
news:57ueh0pt5pqs75ooskdtpcq55gb33ubm0l@4ax.com...
> On Mon, 9 Aug 2004 14:15:53 +0200, "John Kenickney"
> <spam.trap@bigfoot.com> wrote:
>
> >I want to test free nntp servers that I find on the internet. Mostly the
> >reports are not correct; they don't exist anymore or they don't allow
> >posting anymore... It's a time consuming job to do that by hand with an
> >ordinary news reader. Is there a script or program that tests whether a
> >server allows posting or at least tries to post a test message?
>
> We should create an private mailinglist to swap info about open/free
> servers. Much easier. Almost every weblist is 'outdated' (another word
> for 'totally useless').

Unless you have nothing to trade, then you would need a script. Like me :-)

Re: NNTP server test script
#69742
Author: Andrew
Date: Fri, 13 Aug 2004 22:57
32 lines
2837 bytes
"John Kenickney" <spam.trap@bigfoot.com> wrote in message news:<YALRc.13753$_C6.11496@cyclops.nntpserver.com>...
> "Hans" <nospaminmijnbox@pfcorner.nl> schreef in bericht
> news:57ueh0pt5pqs75ooskdtpcq55gb33ubm0l@4ax.com...
> > On Mon, 9 Aug 2004 14:15:53 +0200, "John Kenickney"
> > <spam.trap@bigfoot.com> wrote:
> >
> > >I want to test free nntp servers that I find on the internet. Mostly the
> > >reports are not correct; they don't exist anymore or they don't allow
> > >posting anymore... It's a time consuming job to do that by hand with an
> > >ordinary news reader. Is there a script or program that tests whether a
> > >server allows posting or at least tries to post a test message?
> >
> > We should create an private mailinglist to swap info about open/free
> > servers. Much easier. Almost every weblist is 'outdated' (another word
> > for 'totally useless').
> 
> Unless you have nothing to trade, then you would need a script. Like me :-)

Not sure what you truly want to achieve with this script. Is your goal
to post on a free news server and than look for that message on 1 or
more news servers that are know to function properly? If so you may
want to have a look with PHP (with the PEAR extension). In PHP's PEAR
extension there is a package named Net_NNTP. With that package you can
log into the servers and complete most any task a news reader
application can do (i.e. read, post, get list of messages etc etc).

You may than want to have the message stored into a database and than
nightly have the script check the known servers for a message that
match's the one in the database. If it turns out positive than free
news server truly work.

Andrew
Re: NNTP server test script
#70003
Author: Frank Hellmann
Date: Sun, 26 Sep 2004 22:46
45 lines
3104 bytes
You could use our free pop3/nntp SDK. Its very easy to script.
check http://www.aloaha.com/download/nntpsdk.txt and zip
FH

"Andrew" <nothinglikeroot@gmail.com> schrieb im Newsbeitrag
news:d418637.0408131457.63c8a21f@posting.google.com...
> "John Kenickney" <spam.trap@bigfoot.com> wrote in message
news:<YALRc.13753$_C6.11496@cyclops.nntpserver.com>...
> > "Hans" <nospaminmijnbox@pfcorner.nl> schreef in bericht
> > news:57ueh0pt5pqs75ooskdtpcq55gb33ubm0l@4ax.com...
> > > On Mon, 9 Aug 2004 14:15:53 +0200, "John Kenickney"
> > > <spam.trap@bigfoot.com> wrote:
> > >
> > > >I want to test free nntp servers that I find on the internet. Mostly
the
> > > >reports are not correct; they don't exist anymore or they don't allow
> > > >posting anymore... It's a time consuming job to do that by hand with
an
> > > >ordinary news reader. Is there a script or program that tests whether
a
> > > >server allows posting or at least tries to post a test message?
> > >
> > > We should create an private mailinglist to swap info about open/free
> > > servers. Much easier. Almost every weblist is 'outdated' (another word
> > > for 'totally useless').
> >
> > Unless you have nothing to trade, then you would need a script. Like me
:-)
>
> Not sure what you truly want to achieve with this script. Is your goal
> to post on a free news server and than look for that message on 1 or
> more news servers that are know to function properly? If so you may
> want to have a look with PHP (with the PEAR extension). In PHP's PEAR
> extension there is a package named Net_NNTP. With that package you can
> log into the servers and complete most any task a news reader
> application can do (i.e. read, post, get list of messages etc etc).
>
> You may than want to have the message stored into a database and than
> nightly have the script check the known servers for a message that
> match's the one in the database. If it turns out positive than free
> news server truly work.
>
> Andrew

Re: NNTP server test script
#70047
Author: Conrad J. Sabatier
Date: Sat, 02 Oct 2004 00:44
67 lines
2772 bytes
In article <hTJRc.8593$_C6.863@cyclops.nntpserver.com>,
John Kenickney <spam.trap@bigfoot.com> wrote:
>
>
>I want to test free nntp servers that I find on the internet. Mostly the
>reports are not correct; they don't exist anymore or they don't allow
>posting anymore... It's a time consuming job to do that by hand with an
>ordinary news reader. Is there a script or program that tests whether a
>server allows posting or at least tries to post a test message?

You can do this with the bash shell, using its i/o redirection facilities to 
create a tcp connection to the server.  Here's an example "post" script:

#!/usr/local/bin/bash
#
# usage: post article server
#
# where "article" is the filename of the article to be posted
# should contain, at a minimum, Newsgroups:, Subject: and From: header lines
#
# server is, of course, the address of the server to post to

article=$1
server=$2

# avoid any line-splitting of server's replies
IFS=""

# loop until a connection is established
while true
do
	exec < /dev/tcp/${server}/nntp && read -r && [ "${REPLY%% *}" == "200" ] && break
done

#send post command, check server's reply
echo -e "post\r" >&0
read -r
if [ "${REPLY%% *}" != "340" ]
then
	# echo the server's reply and exit if not OK to post
	echo -E $REPLY >&2
	echo -e "quit\r" >&0
	read -r
	exit 1
fi

# send the article
cat $article >&0
echo -e "\r\n.\r" >&0

# check the server's reply
read -r
if [ "${REPLY%% *}" != "240" ]
then
	# echo the server's reply and exit if not "article posted"
	echo -E $REPLY >&2
	echo -e "quit\r" >&0
	read -r
	exit 1
fi

# do a clean exit
echo -e "quit\r" >&0
read -r
exit 0
-- 
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"
Re: NNTP server test script
#70048
Author: Conrad J. Sabatier
Date: Sat, 02 Oct 2004 00:49
82 lines
3404 bytes
In article <2Sm7d.12534$Hz.12393@fed1read04>,
Conrad J. Sabatier <conrads@cox.net> wrote:
>
>
>In article <hTJRc.8593$_C6.863@cyclops.nntpserver.com>,
>John Kenickney <spam.trap@bigfoot.com> wrote:
>>
>>
>>I want to test free nntp servers that I find on the internet. Mostly the
>>reports are not correct; they don't exist anymore or they don't allow
>>posting anymore... It's a time consuming job to do that by hand with an
>>ordinary news reader. Is there a script or program that tests whether a
>>server allows posting or at least tries to post a test message?
>
>You can do this with the bash shell, using its i/o redirection facilities to 
>create a tcp connection to the server.  Here's an example "post" script:
>
>#!/usr/local/bin/bash
>#
># usage: post article server
>#
># where "article" is the filename of the article to be posted
># should contain, at a minimum, Newsgroups:, Subject: and From: header lines
>#
># server is, of course, the address of the server to post to
>
>article=$1
>server=$2
>
># avoid any line-splitting of server's replies
>IFS=""
>
># loop until a connection is established
>while true
>do
>	exec < /dev/tcp/${server}/nntp && read -r && [ "${REPLY%% *}" == "200"
>] && break
>done

One small potential problem, I just realized, with the above statement.  
This will loop forever if the server returns a "201" (no posting allowed) 
instead of "200" (posting allowed).

Modify accordingly.

Still, pretty amazing what you can do with a relatively simple little bash 
script, isn't it?  :-)

>#send post command, check server's reply
>echo -e "post\r" >&0
>read -r
>if [ "${REPLY%% *}" != "340" ]
>then
>	# echo the server's reply and exit if not OK to post
>	echo -E $REPLY >&2
>	echo -e "quit\r" >&0
>	read -r
>	exit 1
>fi
>
># send the article
>cat $article >&0
>echo -e "\r\n.\r" >&0
>
># check the server's reply
>read -r
>if [ "${REPLY%% *}" != "240" ]
>then
>	# echo the server's reply and exit if not "article posted"
>	echo -E $REPLY >&2
>	echo -e "quit\r" >&0
>	read -r
>	exit 1
>fi
>
># do a clean exit
>echo -e "quit\r" >&0
>read -r
>exit 0

-- 
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"
Re: NNTP server test script
#70049
Author: Alan Connor
Date: Sat, 02 Oct 2004 01:16
47 lines
2309 bytes
On Sat, 02 Oct 2004 00:49:26 GMT, Conrad J. Sabatier
<conrads@cox.net> wrote:

> In article <2Sm7d.12534$Hz.12393@fed1read04>, Conrad
> J. Sabatier <conrads@cox.net> wrote:
>
>
>>In article <hTJRc.8593$_C6.863@cyclops.nntpserver.com>, John
>>Kenickney <spam.trap@bigfoot.com> wrote:

<snip>

> One small potential problem, I just realized, with the above
> statement.  This will loop forever if the server returns a
> "201" (no posting allowed) instead of "200" (posting allowed).
>
> Modify accordingly.
>
> Still, pretty amazing what you can do with a relatively simple
> little bash script, isn't it? :-)
>

Nice job. I've been using telnet and thinking about writing a
netcat script like yours. I'll use it as a template. Thanks.

For the OP:

Here's a list of relatively open (you can't post on most of them)
private newsservers that isn't too old:

http://tinyurl.com/34js7

If you just want to see if the server is up, will allow you to
log on, and list the newsgroups it has:

#!/bin/sh

# put URL or IP address as argument to script name on 
# commandline

(echo list
echo quit
)| netcat -vv "$1" 119 >> file

AC

Re: NNTP server test script
#70052
Author: Conrad J. Sabatier
Date: Sun, 03 Oct 2004 00:27
111 lines
3902 bytes
In article <Ajn7d.520$UP1.292@newsread1.news.pas.earthlink.net>,
Alan Connor  <xxxx@yyy.zzz> wrote:
>
>
>On Sat, 02 Oct 2004 00:49:26 GMT, Conrad J. Sabatier
><conrads@cox.net> wrote:
>
>> In article <2Sm7d.12534$Hz.12393@fed1read04>, Conrad
>> J. Sabatier <conrads@cox.net> wrote:
>>
>>
>>>In article <hTJRc.8593$_C6.863@cyclops.nntpserver.com>, John
>>>Kenickney <spam.trap@bigfoot.com> wrote:
>
><snip>
>
>> One small potential problem, I just realized, with the above
>> statement.  This will loop forever if the server returns a
>> "201" (no posting allowed) instead of "200" (posting allowed).
>>
>> Modify accordingly.
>>
>> Still, pretty amazing what you can do with a relatively simple
>> little bash script, isn't it? :-)
>>
>
>Nice job. I've been using telnet and thinking about writing a
>netcat script like yours. I'll use it as a template. Thanks.

You're welcome, and thank you.  :-)

I've included a new, improved version of the script below, which will 
handle both possible server "greetings" properly, as well as provide a 
little more in the way of feedback, by echoing all of the server's responses 
to stderr:

#!/usr/local/bin/bash
#
# usage: post article server
#
# where "article" is the filename of the article to be posted
#
# should contain, at a minimum, Newsgroups:, Subject: and From: header lines,
# followed by at least one blank line, followed by article body
#
# no "CRLF.CRLF needed at end of article; the script takes care of that
#
# "server" is, of course, the address of the server to post to
#
# server's replies are echoed to stderr
#
# exits with 0 on success, 1 on error or posting not allowed

article=$1
server=$2

# avoid any line-splitting of server's replies
IFS=""

# loop until a connection is established
while true
do
	exec < /dev/tcp/${server}/nntp && read -r &&
		[ "${REPLY%% *}" == "200" -o "${REPLY%% *}" == "201" ] &&
		echo -E $REPLY >&2 && break
done

# quit if posting not allowed
if [ "${REPLY%% *}" == "201" ]
then
	echo -e "quit\r" >&0
	read -r
	echo -E $REPLY >&2
	exit 1
fi

# send post command, check server's reply
echo -e "post\r" >&0
read -r
echo -E $REPLY >&2
if [ "${REPLY%% *}" != "340" ]
then
	echo -e "quit\r" >&0
	read -r
	echo -E $REPLY >&2
	exit 1
fi

# send the article
cat $article >&0
echo -e "\r\n.\r" >&0

# check the server's reply
read -r
echo -E $REPLY >&2
if [ "${REPLY%% *}" != "240" ]
then
	echo -e "quit\r" >&0
	read -r
	echo -E $REPLY >&2
	exit 1
fi

# do a clean exit
echo -e "quit\r" >&0
read -r
echo -E $REPLY >&2
exit 0

-- 
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"
Re: NNTP server test script
#70054
Author: Alan Connor
Date: Sun, 03 Oct 2004 01:35
23 lines
1822 bytes
On Sun, 03 Oct 2004 00:27:54 GMT, Conrad J. Sabatier
<conrads@cox.net> wrote:

> In article
> <Ajn7d.520$UP1.292@newsread1.news.pas.earthlink.net>, Alan
> Connor <xxxx@yyy.zzz> wrote:
>

<snip>

> I've included a new, improved version of the script below,
> which will handle both possible server "greetings" properly,
> as well as provide a little more in the way of feedback, by
> echoing all of the server's responses to stderr:
>

Copied to disk and thanks again, Conrad!

I'll play with it for a while and get back to you here.

AC

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads