Hi,
I'm having problems forwarding email to a pipe. The email is returned to the sender with the error message:
The mail forward script is something I copied from these forums
I also tried changing the first line of the script to "#!/usr/bin/php -q"
Any help would be greatly appreciated!
I'm having problems forwarding email to a pipe. The email is returned to the sender with the error message:
However I do have intermediate level php enabled for my account and when I try emailing myself from a php script opened in my browser it works just fine------ pipe to |/home/mcarroll/public_html/forwardMail.php
generated by mofo@mofo.x10hosting.com ------
ALERT - function within blacklist called: mail() (attacker 'REMOTE_ADDR not set', file '/home/mcarroll/public_html/forwardMail.php', line 53)
X-Powered-By: PHP/5.2.6
Content-type: text/html
Is the mail forward script somehow not picking up that my account has permission to use mail() ?$send = mail($to, $subject, $body, $headers);
The mail forward script is something I copied from these forums
Code:
#!/usr/bin/php
<?php
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd))
{
$email .= fread($fd, 1024);
}
fclose($fd);
// handle email
$lines = explode("\n", $email);
// empty vars
$from = "";
$subject = "";
$headers = "";
$message = "";
$splittingheaders = true;
for ($i=0; $i < count($lines); $i++)
{
if ($splittingheaders)
{
// this is a header
$headers .= $lines[$i]."\n";
// look out for special headers
if (preg_match("/^Subject: (.*)/", $lines[$i], $matches))
{
$subject = $matches[1];
}
if (preg_match("/^From: (.*)/", $lines[$i], $matches))
{
$from = $matches[1];
}
}
else
{
// not a header, but message
$message .= $lines[$i]."\n";
}
if (trim($lines[$i])=="")
{
// empty line, header section has ended
$splittingheaders = false;
}
}
mail("myUserName@hotmail.com", $subject, $message, $headers);
?>
Any help would be greatly appreciated!