Ask a Question related to PERL Miscellaneous, Design and Development.
-
Mike #1
Posting with Net::NNTP
Hey guys,
I really appeciate all the help you've given me so far regarding
Net::NNTP.
I've been able to successfully view posts in specific newsgroups now,
using a "public" news server. However, I'm trying to post, and
although the program runs without errors, nothing's posting. Can
someone glance this script over and let me know if it's the program or
the server?
#!/usr/bin/perl
use Net::NNTP;
use strict;
my $server = "news.so-net.com.hk";
# one of a few that I tried; also tried my ISP
my $group = "alt.test";
my $nntp = Net::NNTP->new($server, Debug => 0) or die "Can't connect
to server: $!\n";
my @message = (
"Subject: This is a Test",
"From: Mike <csdude\@spampolice.com>",
"Newsgroups: $group",
"\nThis is an Net::NNTP test.\n"
);
$nntp -> post(@message);
$nntp->quit;
print "Content-type: text/html\n\n";
print "Success\n\n";
exit;
TIA,
Mike
Mike Guest
-
NNTP Feed
Can anyone tell me if the NNTP servers are down. I'm trying to access the forums using Outlook Express and it is not able to connect or find the... -
CDOSYS NNTP
Is it possible to send/receive nntp messages via CDOSYS without a 3rd party news component? The NNTP links I have found appear to be related to MS... -
Anybody got a NNTP Class?
Any recommendations for hooking up PHP pages to the usenet newsgroups, i.e. reading them and posting to them. I'm looking for a nice, clean class... -
View NG with Net::NNTP
I tried posting a few minutes ago via Google, and got an ISE, so please forgive me if I'm repeating. I have a client that would really benefit... -
Best NNTP lib?
Hello, all. I think I've heard of at least four NNTP libraries in Ruby -- two in the RAA, and (I think) another two not therein. I just want... -
John W. Krahn #2
Re: Posting with Net::NNTP
Mike wrote:
>
> I really appeciate all the help you've given me so far regarding
> Net::NNTP.
>
> I've been able to successfully view posts in specific newsgroups now,
> using a "public" news server. However, I'm trying to post, and
> although the program runs without errors, nothing's posting. Can
> someone glance this script over and let me know if it's the program or
> the server?
>
> #!/usr/bin/perl
> use Net::NNTP;
> use strict;
>
> my $server = "news.so-net.com.hk";
> # one of a few that I tried; also tried my ISP
> my $group = "alt.test";
>
> my $nntp = Net::NNTP->new($server, Debug => 0) or die "Can't connect
> to server: $!\n";
>
> my @message = (
> "Subject: This is a Test",
> "From: Mike <csdude\@spampolice.com>",
> "Newsgroups: $group",
> "\nThis is an Net::NNTP test.\n"
> );
>
> $nntp -> post(@message);
> $nntp->quit;
>
> print "Content-type: text/html\n\n";
> print "Success\n\n";
> exit;
According to RFC977:
3.10. The POST command
3.10.1. POST
POST
If posting is allowed, response code 340 is returned to indicate that
the article to be posted should be sent. Response code 440 indicates
that posting is prohibited for some installation-dependent reason.
If posting is permitted, the article should be presented in the
format specified by RFC850, and should include all required header
lines. After the article's header and body have been completely sent
by the client to the server, a further response code will be returned
to indicate success or failure of the posting attempt.
[url]http://www.rfc-editor.org/rfc/rfc977.txt[/url]
RFC850 has been obsoleted by RFC1036:
[url]http://www.rfc-editor.org/rfc/rfc1036.txt[/url]
John
--
use Perl;
program
fulfillment
John W. Krahn Guest
-
Tina Mueller #3
Re: Posting with Net::NNTP
Mike wrote:
> I've been able to successfully view posts in specific newsgroups now,
> using a "public" news server. However, I'm trying to post, and
> although the program runs without errors, nothing's posting. Can
> someone glance this script over and let me know if it's the program or
> the server?
[...]missing newline> my @message = (
> "Subject: This is a Test",
again> "From: Mike <csdude\@spampolice.com>",
and again...> "Newsgroups: $group",
hth, tina> "\nThis is an Net::NNTP test.\n"
> );
--
[url]http://www.tinita.de/[/url] \ enter__| |__the___ _ _ ___
[url]http://Movies.tinita.de/[/url] \ / _` / _ \/ _ \ '_(_-< of
[url]http://www.perlquotes.de/[/url] \ \ _,_\ __/\ __/_| /__/ perception
- the above mail address expires end of december 2003 -
Tina Mueller Guest
-
Mike #4
Re: Posting with Net::NNTP
> [...]
>> > my @message = (
> > "Subject: This is a Test",
> missing newline
Thanks, John and Tina. The \n was exactly it. Geez, you'd have thought
I would have caught that myself! I think my brain's starting to fry...
Mike
Mike Guest



Reply With Quote

