Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29748

Piping to a shebang PHP program in CPANEL and permissions to write

$
0
0

I have set up a PHP program to be piped to when an email hits the queue. Something I have done in the past with no problems. According to CPANEL the program and the path to it must be 0700 or 0755 whichever manual you read and now must be done with an email filter. I am using 755 because that is what I used to always do. I put some dummy code in to be piped to just to make sure everything is working.

#!/usr/bin/php 
<?php
/* Read the message from STDIN */
$fd = fopen("php://stdin", "r");
$email = ""; // This will be the variable holding the data.
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
/* Saves the data into a file */
$fdw = fopen("dummy.txt", "w+");
fwrite($fdw, $email);
fclose($fdw);
/* Script End */
?>

when I send an email which should trigger the program. I get nothing...no file written, no error messages, nothing. If I use a browser and run the program. It creates the file but since I am using stdin it sees nothing and writes nothing...but I do get a blank file. So why can I not write, when it hits the mail queue?

Am I just getting too old to program anymore? Drives me mad, I've done this a million times but now I have to go to message boards for help. 70 aint easy...just wait till you get there :( The help desks at the server farms, know way less than me and don't even know what a pipe is, so no joy there.


Viewing all articles
Browse latest Browse all 29748

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>