Posting with Net::NNTP

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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?

    [...]
    > my @message = (
    > "Subject: This is a Test",
    missing newline
    > "From: Mike <csdude\@spampolice.com>",
    again
    > "Newsgroups: $group",
    and again...
    > "\nThis is an Net::NNTP test.\n"
    > );
    hth, tina
    --
    [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

  5. #4

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139