Thread View: news.software.nntp
2 messages
2 total messages
Started by Bilbo
Wed, 19 Jan 2000 00:00
Net::NNTP - problem posting to newsgroups
Author: Bilbo
Date: Wed, 19 Jan 2000 00:00
Date: Wed, 19 Jan 2000 00:00
88 lines
3356 bytes
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 -----------
Re: Net::NNTP - problem posting to newsgroups
Author: Andrew Gierth
Date: Wed, 19 Jan 2000 00:00
Date: Wed, 19 Jan 2000 00:00
34 lines
2430 bytes
2430 bytes
>>>>> "Bilbo" == Bilbo <bilbo_baggins50@hotmail.NOSPAM.com> writes: Bilbo> I'm trying to post to a newsgroup via a perl script. I have Bilbo> found an open news server that will allow postings and I have Bilbo> succesfully posted to some newsgroups via the script below. Bilbo> The problem is finding a news server that carries the Bilbo> newsgroup uk.aderts.telecom.mobile, allows open connection and Bilbo> will allow posts to be made. Why? Why not use the server provided by your ISP? Or failing that, subscribe to any of the subscription Usenet providers. The number of servers that intentionally allow public posting (other than for specific private hierarchies) is essentially zero, due to the level of abuse which is invariably perpetrated once such servers are found. If you find a server open for posting, it's almost certainly due to an administrative error - so you can hardly expect it to provide reliable service. Furthermore, most so-called lists of "public" servers are in fact nothing of the kind - they merely list the set of servers which are, intentionally or otherwise, open to the compiler of the list. The appearance of a server on such a list does not constitute permission to access the server. As for your code, use Net::NNTP's Debug option (see the docs), or display the value of $nntp->message() after a failed post (see the docs for Net::Cmd). -- Andrew.
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