I'm trying to forward my site's incoming mail to a PHP script for it to be filtered an remailed to other addresses according to their content.
I've created a .forward file in my home directory and put in the following code:
myemail@yahoo.com,"|/public_html/myfolder/incl_mail.php"
Also, in the incl_mail.php file I've put this in the first line:
#!/usr/bin/php
<?php
Rest of the code
?>
All the emails that I send to my site are correctly sent to the email address but never get to the php script. I get a mail back saying that my message was undeliverable:
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 |/public_html/myfolder/incl_mail.php
generated by mysite@gator4.hostgator.com
(ultimately generated from test@mysite.com)
Does anybody know what I'm doing wrong? Am I putting in the path incorrectly (not full path)? Might it be my hosting company? I'd appreciate some help.
Thanks!