Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Insecure switch while working in ENV{PATH}

by heatblazer (Scribe)
on Apr 11, 2012 at 11:42 UTC ( #964514=perlquestion: print w/ replies, xml ) Need Help??
heatblazer has asked for the wisdom of the Perl Monks concerning the following question:

Hello, monks.
I was trying a simple excersise script for using the local system`s sendmail while piping to it but the console shout me:

Insecure $ENV{PATH} while running with -T switch at ./perlmail.pl line + 30.

And my line 30 is a part of a subroutine:

sub send_mail { my ($from, $to, $subject, $data) = @_; open(MAIL, "| sendmail -t") or die "Can`t start sendmail: $!\n"; print MAIL "To: $to\n"; print MAIL "Cc: $subject\n"; print MAIL "Data: $data\n"; close(MAIL) or die "Can`t close sendmail filehandle: $!\n"; }

Why is that warning and what is my mistake?

Comment on Insecure switch while working in ENV{PATH}
Select or Download Code
Re: Insecure switch while working in ENV{PATH}
by moritz (Cardinal) on Apr 11, 2012 at 11:44 UTC
Re: Insecure switch while working in ENV{PATH}
by JavaFan (Canon) on Apr 11, 2012 at 11:45 UTC
    Your PATH is insecure.

    Set it. And use a full path to sendmail (if necessary).

    See also man perldiag (search for "Insecure") and man perlsec.

Re: Insecure switch while working in ENV{PATH}
by marto (Bishop) on Apr 11, 2012 at 11:50 UTC

    After all this you're still not using MIME::Lite to make life easier for you?

      Ahem... I am learning Perl so I am getting used to it... using a ready-made module is no good for a learner like me.


      P.S.: I`ll use MIME::Lite in a real thing.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://964514]
Approved by moritz
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2015-07-05 04:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls