Yes, its possible to pipe to a PHP script. I've setup an email address to listen for news postings from only a few of my other email addresses. It takes the email subject and turns it into the news subject and the email message body and turns that into the news message body and then it gets tossed into a database.
I set mine up as an email forwarder and had it forward directly to my script:
|/home/[username]/[scriptname].php
Then to read the data, you do:
if ($fp=fopen("php://stdIn", "r"))
{
while (!feof($fp))
{
$line=fgets($fp, 4096);
} // end while (!feof($fp))
} // end if ($fp=fopen("php://stdIn", "r"))
You'll have to do some string checking to determine what line is what (like if the line is the subject line, from line, message body, etc). But the above code should at least read in the entire email. What you do from there is up to you...