Results 1 to 1 of 1
Thread: PHP script for e-mail piping
Nov 18, 2004, 05:21 #1
- Join Date
- Aug 2003
- 0 Post(s)
- 0 Thread(s)
PHP script for e-mail piping
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:
#!/usr/bin/php <? // Get Input data unset($data); $input = fopen('php://stdin','r'); while(!feof($input)) $data .= fread($input,2048); /* Doing some stuff with the data from the e-mail */ exit(0); ?>
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 ------