Thanks for the response Wolf. Actually I was coming back here to post an update. In the early hours this morning I discovered that about the piping. And I just now finally got the script working like I want. I'll post some here because it was such a struggle for me, maybe it will help someone else.
I have my forwarder pointed to > "| /full/path/to/cgi-bin/script.php"
I have chmod the script to 755
The start of my script is:
#!/usr/bin/php -q
<?php
// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd)
Some code here The end of my script
mail($emailto,$subject,$message);
exit();
?>
After discovering the piping, i was able to get the emails to the script and the script would parse the email and pull out the variables exactly as I wanted. Then i create another email with those variables and email it to me just for testing purposes to make sure the script is parsing the original correctly. The email did make it to me with all the variables. All that is great! The downside was that I kept getting a returned email from the server (mailer-daemon) saying
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
pipe to | /full/path/to/cgi-bin/script.php
generated by
test@_mydomain_.comThe following text was generated during the delivery attempt:
------ pipe to | /full/path/to/cgi-bin/script.php
generated by
test@_mydomain_.com ------
X-Powered-By: PHP/4.4.2
Content-type: text/html
What i discovered this morning was that in the first line of the script you need to have the -q directive.
#!/usr/bin/php -q
After adding that directive, the script is still receiving the emails and parsing but I am not getting the bounced email now. Hope this helps someone.

Scott
-----------------------------------------
http://www.chaseserver.com