Dear Monks,

I wonder if anyone can explain what would cause a perl CGI script to fail when accessed in certain web browsers and succeed in others.

All I’m doing is taking an email address from a form, feeding it to a validation sub that untaints it, then using it with the –f option to sendmail. It works fine in Mozilla browsers on both Mac and PC, as well as in Safari on the Mac, but Internet Explorer on either platform gives “Insecure dependency in piped open while running with -T switch” at the line where I open a pipe to sendmail. (I'm using CGI::Carp qw(fatalsToBrowser).)

The relevant bits are

... my $user_email = validate_email_address( param( "Email" ) ); ... open MAIL, "| /usr/lib/sendmail -t -i -f '$user_email' " or die "Could not open sendmail: $!";

The validate_email_address sub comes straight from CGI Programming with Perl, chapter 9. It’s too long to include here but its final line is

return $addr_to_check =~ /^$address$/ox ? $addr_to_check : "";

This is on a company intranet, running Perl 5.004_04. Server is iPlanet-WebServer-Enterprise/6.0.

Any suggestions on how to tackle this would be greatly welcomed!


In reply to Browser-specific perl error?? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.