<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
<TITLE>ENV taint errors with sendmailpipe</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>hi,</FONT>
</P>

<P><FONT SIZE=2>i've been setting up RT (with RT 2.0.8_02 and qmail on a Solaris Box) all seem well, with web ui working, but i initially didn't get any mail sent from the Scrips set up to do so. after some reading and failures i got to a config.pm with;</FONT></P>

<P><FONT SIZE=2> # {{{ Outgoing mail configuration</FONT>
<BR><FONT SIZE=2> $MailCommand = 'sendmailpipe';</FONT>
<BR><FONT SIZE=2> $SendmailArguments="-oi -t";</FONT>
<BR><FONT SIZE=2> $SendmailPath = "/var/qmail/bin/sendmail";=$UseFriendlyToLine = 0;</FONT>
</P>

<P><FONT SIZE=2>which gave the following errors in the apache error and rt logs when it tried to send a mail after a ticket creation;</FONT>
</P>

<P><FONT SIZE=2> Insecure $ENV{PATH} while running with -T switch at /usr/local/rt2/lib/RT/Action/SendEmail.pm line 109, <GEN0> line 47.</FONT></P>

<P><FONT SIZE=2>line 109 is;</FONT>
<BR><FONT SIZE=2> open (MAIL, "|$RT::SendmailPath $RT::SendmailArguments") || return(0);</FONT>
</P>

<P><FONT SIZE=2>all the web scripts in my rt bin look like they set the ENV{PATH} to a constant so should untaint it, but i kept getting the error. so i hacked SendEmail.pm to local %ENV and set $ENV{PATH} to nothing when it runs the piped mail command, which got it working.</FONT></P>

<P><FONT SIZE=2>anyone know whats going on, or seen this before? as i dont think my hack is really a proper solution (but does work) ;-)</FONT></P>

<P><FONT SIZE=2>have fun,</FONT>
<BR><FONT SIZE=2>grommit</FONT>
</P>

</BODY>
</HTML>