I know that there have been quite a few posts floating around on this subject but I am still stuck it seems.
I have set cPanel up so that any emails that go to support@mydomain.com will be picked up and processed by a PHP script.
Now after much battling I have been able to get it to basically forward the email onto another address yet it is still bouncing the original email back to the sender too which seems weird to me. Here is the script that I use:
#!/usr/bin/php -q
<?php
$fd = fopen("php://stdin", "r");
$email = '';
while(!feof($fd))
{
$email .= fread($fd, 1024);
}
fclose($fd);
mail('reciever@mytest.com', 'test', $email);
?>
And I have also tried to control the issue with output buffering and yes before you ask the script is chmod'd to 755...
Any help really would be appreciated as it is starting to annoy me now.