I'm trying to set up an e-mail filtering script for all the e-mails sent to a specific e-mail address.
I've set up the script to run using CPanel 9.9.8. The script looks basically like this:
The Script runs fine and the data from the e-mail gets loaded. But everytime I send an e-mail that parses through the script I get a "Mail delivery failure" e-mail back from the server.
// Get Input data
$input = fopen('php://stdin','r');
$data .= fread($input,2048);
Doing some stuff with the data from the e-mail
I suppose the problem is that I should return some kind of value from the script to the server that indicates the script has run successfully. I'm not sure though.
Oh and the "Mail delivery failure" e-mail looks like this:
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 |/home/scripts/emailparser.php
generated by firstname.lastname@example.org
The following text was generated during the delivery attempt:
------ pipe to |/home/scripts/emailparser.php
generated by email@example.com ------