I’m trying to pipe email sent to an address to a php script.
I’ve put in the Feed to Program in the email aliases file.
The php file has permissions 6755. That gives everyone exectution access, and has it run as the group of the folder so it will have access to everything in the folder. All of the directories down to the script have the permission List granted to everyone. The final directory has Read granted to everyone.
When I send an email to the address, I get nothing.
The php file consists of,
[code]#!/usr/bin/php
<?php echo 'got it'; ?>[/code]If the path in the alias file is incorrect, it reports a “Could not open input file:” error.
I believe that it should be sending me a response saying ‘Got it’.
I’ve also tried to change the file to
#!/usr/bin/php
<?php ob_start();
echo 'got it';
echo ' PID:'.getmypid();
echo ' GID:'.getmygid();
echo ' User:'.get_current_user();
$logfile = fopen('bcastlog.txt', "a");
$log = ob_get_contents();
fputs($logfile, date( "Y-m-d H:i:s", time() )." $log\n");
fclose($logfile);
?>
which should log the information into a log file. Again, nothing happens and I can’t find any error logs to look at.
Of course, these scripts all run via the web…
If the path were wrong, it should give me the could not find input file error. If permissions were preventing access, I should see a Permission denied error. (These would both be part of the bounceback, which is fine during testing. I’ll suppress that later.) But I’m not getting ANY feedback at all. Nada.
<I know that the email is going to the proper address because I’ve also set the alias file to forward it back to me and I’m receiving the original message. Also - I’ve looked in the messagelog and see,
to=<XXX-XXX.com@rhost1.XXX.com>, orig_to=<XXX@XXX.com>, relay=local, delay=0.22, delays=0.13/0.01/0/0.08, dsn=2.0.0, status=sent (delivered to command: php -c /home/XXX/domains/XXX.XXX.com/etc/php5/php.ini -f /home/XXX/domains/XXX.XXX.com/public_html/echo1.php)
so it is going to the proper place.>
Any help is greatly appreciated.
Thank you,
Rob