> Peter Scott <[EMAIL PROTECTED]> said:

> Yes, but if you create the above using something like
> 
>          open (MAIL, "|/usr/sbin/sendmail $email")
> 
> to which you should by the way add
> 
>          or die "sendmail: $!\n";

I left the "die" off for brevity.  Good point.

> then you now need to validate $email to make sure that it isn't something like
> 
>          [EMAIL PROTECTED]; rm -rf /

Good point, given the perl open does shell-like expansions.

> Better to use
> 
>          open MAIL, "|/usr/sbin/sendmail -oi -t" or die "sendmail : $!\n";
>          print MAIL <<"EOF";
>          To: $email

Yep, using "-t" is an alternative.  In some cases I prefer my method, 
especially if I am sending messages to a mailing list, since I can manipulate 
the header addresses separately from the envelope address.

> etc.  Oh, and check the status on the close.

Yep.


-- 
Smoot Carl-Mitchell
Consultant





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to