I have a PHP pipe file that looks like:
#! /usr/bin/php -q
<?php
$fd = fopen("php://stdin","r");
$email = "";
while (!feof($fd))
{ $email .= fread($fd, 1024); }
fclose($fd);
$fdw = fopen("/home/user/pipemail.txt","w+");
fwrite($fdw, $email);
fclose($fdw);
mail("email@email_provider.com","You got mail","You received a new email.","From: no-reply@domain.com");
?>
When I sent an email from one of my email accounts, I noticed that the script successfully saved email header to the “pipemail.txt” file. However, it’s not sending an email to “email@email_provider.com”.
Does anyone knows what may be the problem? Do I have to adjust any settings somewhere?
Ok I’ve found the reason behind the problem I described above.
It’s because the IP address where my website is hosted (I’m using a shared IP) has been blacklisted by several servers as someone else abused the system. In any case, it seems like I would have to wait for the blacklists to be cleared and next time also buy a dedicated IP address.
Thanks to robobooga for posting a possible solution even though I couldn’t use it. Thumbs-up to your knowledge in the field =)