🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.free.newsservers
Article #164185

Re: What is a quick Linux bash test of a free public newsserver on VPN?

#164185
From: VPN user
Date: Wed, 30 Mar 2016 00:45
50 lines
2504 bytes
VPN user wrote in message ndboei$tur$2@news.mixmin.net

> Nobody? 
> Not even Michael Baeuerle?
> 
> I can *manually* test posting using any of a number of news servers:
> 1. telnet nntp.aioe.org nntp
> 2. telnet freenews.netfront.net 119 
> 3. telnet news.mozilla.org 119
> 4. (more complicated)
>    $ openssl s_client -connect news.mixmin.net:563

There are many ways to solve the problem, but, not being much of a coder, 
I solved the problem with a bash shell script and with a tcl expect script.

Here is the except TCL script.
(BTW, what do people use for filename extensions for "expect" scripts?)

#!/usr/bin/expect
# Test if NNTP posting is allowed by a given news server for the current VPN connection.
# Use Model: $ vpnnntp.tcl nntp.aioe.org 119
# Output: A message will state whether posting is allowed, or not.

# Abort if the process takes more than 10 seconds.
# WIP: Need to test if this actually works as I haven't seen it happen yet.
set timeout 10

# Obtain the newsserver & NNTP port from the command line:
set _server [lindex $argv 0]
set _port [lindex $argv 1]
send_user "...Connecting to ${_server}:${_port}\n"

# Report whether the newsserver allows NNTP posting for this VPN connection.
spawn telnet $_server $_port
send_user "...Checking for connection-refused or for posting-ok condition...\n"
expect {
   "200 nntp.aioe.org InterNetNews NNRP server INN 2.5.4 ready (posting ok)"
   {
     send_user "...Good: Posting is allowed by ${_server}:${_port}\n"
     send "quit\r"
   }

   "Connection refused"
   {
     send_user "...Oops: Connections are refused by ${_server}:${_port}\n"
   }

 }

expect eof
Technical Details
Message-ID: <ndf7j1$29b$9@news.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail
References: <nda1rf$65o$1@news.mixmin.net> <ndboei$tur$2@news.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <ndf7j1$29b$9@news.mixmin.net>
Subject: Re: What is a quick Linux bash test of a free public newsserver on VPN?
Date: Wed, 30 Mar 2016 00:45:21 +0000
From: VPN user <vpnuser@example.com>
References: <nda1rf$65o$1@news.mixmin.net> <ndboei$tur$2@news.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail
Newsgroups: alt.free.newsservers
Organization: Mixmin
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 30 Mar 2016 00:45:21 -0000 (UTC)
Injection-Info: news.mixmin.net; posting-host="2ca620a667accfe18cc30c1cbea46e4236ad982d";
Lines: 49