On Fri, Nov 19, 1999 at 05:59:24PM -0800, Denis Voitenko wrote:
> 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);
[...]
> 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).
Your script reads and writes only the first line. You want:
open(OUT, ...);
while (<>) {
print OUT;
}
close(OUT);
or (if this looks wierd to you):
open(OUT, ...);
while (($input = <STDIN>)) {
print OUT $input;
}
close(OUT);
There are other problems. Two messages delivered at the same time may become
mixed in your outfile, so you need some type of lock - I assume this is
for testing only...
--Sincerely, Fred
Fred Lindberg, Inf. Dis., WashU, St. Louis, MO, USA