/[cvs]/nfo/perl/scripts/dispatchmail/bin/postmessage
ViewVC logotype

Contents of /nfo/perl/scripts/dispatchmail/bin/postmessage

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Sun Nov 7 03:13:11 2004 UTC (19 years, 8 months ago) by bd
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
U changed email address

1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Data::Dumper;
7 use Net::NNTP;
8 use News::Article;
9
10
11 my $connInfo = {
12 host => 'news.netfrag.org',
13 user => 'collector',
14 pass => 'col5%',
15 };
16
17 # connect to news-server
18 my $nntp = Net::NNTP->new( $connInfo->{host} );
19
20 # authenticate with nntp-server
21 $nntp->authinfo( $connInfo->{user}, $connInfo->{pass} );
22
23
24 # read smtp-message from STDIN
25 my @msg_smtp = <STDIN>;
26
27 # build news-message
28 my $msg_nntp = News::Article->new( \@msg_smtp );
29
30 $msg_nntp->set_headers(
31 'Newsgroups', 'alt.test',
32 'From', 'test@netfrag.org',
33 );
34
35 # tracing
36 print Dumper($msg_nntp);
37 #exit;
38
39 # post message to news-server
40 $msg_nntp->post( $nntp );
41
42 # disconnect from news-server
43 $nntp->quit;
44
45 1;
46

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed