#!/usr/bin/perl

#
# Fetches USENET posting for the given message id
#
# (c) martin@divbyzero.net, 2003
#

use Net::NNTP;

my $server = "nntp.example.com";
my $username = "foo";
my $password = "bar";

my $id = shift @ARGV
    or die "usage: $0 message-id\n";

$nntp = Net::NNTP->new($server);
if (!$username eq "") {
    $nntp->authinfo($username, $password) || die "Auth failed $!";
}

my $article = $nntp->article('<' . $id . '>');

print @$article;

$nntp->quit;

