In my previous article “PHP e-mail PIPE, cPanel PIPE forwarding” I was explaining how you can create an e-mail PIPE and get the e-mail with PHP.
This is the code you should use to get the email from stdin:

// read from stdin
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);

Now, we have the content [...]