🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #43521

Net::NNTP - problem posting to newsgroups

#43521
From: Bilbo
Date: Wed, 19 Jan 2000 00:00
88 lines
3356 bytes
I'm pulling my hair out trying to get this to work, so I'd appreciate any
help...

I'm trying to post to a newsgroup via a perl script. I have found an open
news server that will allow postings and I have succesfully posted to some
newsgroups via the script below.

The problem is finding a news server that carries the newsgroup
uk.aderts.telecom.mobile, allows open connection and will allow posts to be
made.

I've been unsuccessful, so far, in finding suitable news servers. It's a big
job, (even when using News Hunter or www.jammed.com ) - it seems that the
news servers that appear to carry this newsgroup allow posting, and my
script (below) will recognise this but then gets the error "Can't Post". The
script DOES post succesfully to other newsgroups, like alt.test, uk.test etc
so it's very confusing :-(

Maybe the code is correct and I just need to find a suitable news server
that carries this newsgroup and allows posts to be made? I'm no expert on
NNTP, so perhaps there is something wrong with my script, or that certain
newsgroups are more stringent on the header sent?

TIA for any suggestions.

Please respond to this newsgoup or email me at
bilbo_baggins50@hotmail.NOSPAM.com
(please remove .NOSPAM to email me)


----------- PERL CODE FOLLOWS -----------

#!/usr/bin/perl

use Net::NNTP;

$nntp= Net::NNTP->new; #use default port and options

#$ns="freenews.netfront.net";  #NEWS SERVER TO CONNECT TO
$ns="newssrv2.hrz.uni-oldenburg.de";

$ng="alt.test";   #NEWSGROUP
#$ng="uk.adverts.telecom.mobile";

print "\n\nGETTING READY TO CONNECT...\n";

$server= Net::NNTP->new($ns) or die "can't connect to news server $@\n";

print "Ok, connected to news server: $ns\n";

($narticles, $first, $last, $name) = $server->group($ng) or die "can't
select newsgroup:$ng\n";

print "Ok, have selected newsgroup: $ng\n";

@lines="From: bilbo_baggins50\@hotmail.NOSPAM.com (bilbo)
Newsgroups: $ng
Subject: $ns Test
Organization: Test Labs Inc
Distribution: world
X-No-Archive: Yes

This is just a test message

Testing 1 2 3...
posted via $ns
bilbo_baggins50\@hotmail.NOSPAM.com (remove .NOSPAM to email me)
";

$server->postok() or warn "server didn't tell me i could post: \n";

print "Ok, news server allows posting...\n";

$server->post(@lines) or die "can't post: $!\n";

print "\n\nPOSTED SUCCESSFULLY!!!!";

------------- END PERL CODE -----------









Technical Details
Message-ID: <864nv7$psr$1@nclient15-gui.server.virgin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.modules.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <864nv7$psr$1@nclient15-gui.server.virgin.net>
Subject: Net::NNTP - problem posting to newsgroups
Date: Wed, 19 Jan 2000 00:00:00 +0000
From: "Bilbo" <bilbo_baggins50@hotmail.NOSPAM.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.modules.mbox.zip!not-for-mail
X-Deja-AN: 574740388
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Complaints-To: abuse@virgin.net
X-Trace: nclient15-gui.server.virgin.net 948298535 26523 194.168.253.6 (19 Jan 2000 16:15:35 GMT)
Organization: Virgin Net Usenet Service
X-MSMail-Priority: Normal
NNTP-Posting-Date: 19 Jan 2000 16:15:35 GMT
Newsgroups: comp.lang.perl.misc,comp.lang.perl.modules,news.software.nntp