My problem is not sending mail. It is passing the message to the script so
it could process it. For now my script looks like this:
#!/usr/bin/perl
$input=<STDIN>;
open(OUT, ">>/home/robot/email.txt");
print OUT $input;
close(OUT);
and when .qmail that looks like this:
| /usr/bin/perl /home/robot/script.pl
invokes it, it writes stuff like this:
Received: (qmail 22673 invoked from network); 19 Nov 1999 23:47:12 -0000
Received: (qmail 22710 invoked from network); 19 Nov 1999 23:49:00 -0000
Received: (qmail 22694 invoked from network); 19 Nov 1999 23:48:07 -0000
into email.txt. Nice loggin thingy but not what I want. I want to to write
the message with all the headers, etc. into the file (for now).
As far as I see it is not script's fault. There is something wrong with the
way I pipe stuff to it.
Denis Voitenko
Tel: 856 809-9252
Mail: [EMAIL PROTECTED]
ICQ: 9396092
----- Original Message -----
From: Magnus Bodin <[EMAIL PROTECTED]>
To: Denis Voitenko <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, November 19, 1999 12:57 PM
Subject: Re: message body --> script ?
> On Fri, Nov 19, 1999 at 02:48:53PM -0800, Denis Voitenko wrote:
> > I have a silly idea of writing a small robot that would accept message
> > bodies in format like
> >
> > http://www.whateverurlyouwhish.com
> > http://... [as many urls as you wish]
> >
> > and reply to it with the content of the web page. I have attempted to do
so
> > by creating an alias like .qmail-robot with content
> >
> > | /home/robot/script.pl
> >
> > but something is not working out. Should I pass messages some other way?
>
> If the script just prints the webpages to stdout then you're doing it
wrong.
> You must send the content to a pipe
>
> like this ($newbody contains your fetched pages):
>
> open MAIL,"| /var/qmail/bin/qmail-inject $ENV{SENDER}";
> print MAIL "From: url auto responder <url\@whatever.com>\n";
> print MAIL "\n";
> print MAIL "$newbody";
> close MAIL;
>
> /magnus
>
>
>
>