summaryrefslogtreecommitdiff
path: root/src/postfix_handoff.pl
blob: 88c66751cd3a42bc0b6130f88b399267ef4c8dd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w

use LWP::UserAgent;
use HTTP::Request::Common qw(POST);

local $/;
my $msg = <STDIN>;

my $url = 'http://www.test2.nomic.net/list_post_receive.php';

my $ua = LWP::UserAgent->new;
my $req = POST $url, [ message => $msg ];

my $res = $ua->request($req);

unless ($res->is_success()) {
  die 'POST failed: ' . $res->status_line . ' ' . $res->content;
}