On Fri, Mar 29, 2002 at 10:13:59AM +0700, Olivier Nicole wrote:
> > However, if I
> >use telnet and try to GET or POST it, I'm told it doesn't exist.
> 
> Humm, I suspect a HTTP protocol version problem.
> When you telnet, do you specify any HTTP version on the GET command?

I did a quick search around the net and found examples of the fields
for formmail.pl.  Here's a small Perl script that will do something like
what was requested (note, I haven't actually run this, so the results
you get are unknown to me right now ...)  It's attached. :)

-- 
Randomly Generated Tagline:
Anyone who remembers the 60's...wasn't there.
#!/usr/local/bin/perl -Tw
use strict;
use URI::URL;
use LWP::UserAgent;

foreach (@ARGV) {
    FormMail($_);
}

sub FormMail {
    my ($url) = @_;
    return unless ( defined $url );

    $url =~ m@http://([^/:]+)@;
    my $host = $1;
    die "No host in URL?!?!:$!" unless ( defined $host );

    my (%form) = (
        'recipient' => '[EMAIL PROTECTED]',
        'subject'   => "I'm an open formmail.pl server!",
        'email'     => 'postmaster@' . $host,
        'comments'  => q&DSBL Message
I don't remember what the format is.
And they don't seem to be giving out the "cookies" yet.
Very sad.  I'd like a cookie.  Chocolate chip please.
DSBL END
&
    );

    my $ua = new LWP::UserAgent;

    #$ua->proxy(http  => 'http://proxy:port');
    my $req = new HTTP::Request 'POST', $url;
    $req->content_type('application/x-www-form-urlencoded');

    my $curl = url("http:");    # create an empty HTTP URL object
    $curl->query_form(%form);
    $req->content( $curl->equery );    # %form content as escaped query string

    $ua->request($req);
}

Reply via email to