diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/postfix_handoff.pl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/postfix_handoff.pl b/src/postfix_handoff.pl new file mode 100755 index 0000000..88c6675 --- /dev/null +++ b/src/postfix_handoff.pl @@ -0,0 +1,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; +} |