Hey, I am trying to write a script for my ISPConfig install. I am trying to pipe an e-mail to my php script but I am getting this error: cannot append message to destination file /var/www/web7/web/network/email/email.php: cannot open file: Permission denied This is my config: .forward: |/usr/bin/php /var/www/web7/web/network/email/email.php email.php: chown - postfixostfix chmod - 755 <?php // read from stdin $fd = fopen("php://stdin", "r"); $email = ""; while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); $message = 'bla' ; mail('[email protected]', 'Backups', $message); ?> Any help would be great!!! Many Thanks Chris.
Ok, I have made some changes and this is not working, I am going to look at other ways of doing this.
Hey, This is the out put: -rwxr-xr-x 1 web7_techtest phpmyadmin 211 2007-10-28 18:01 email.php Many Thanks
Can you post the full output? I wanted to see the permissions of /var/www/web7/web/network/email as well.
ah sorry!!! total 44 drwxr-xr-x 3 root root 4096 2007-10-29 02:43 . drwxrwxrwx 11 root root 4096 2007-10-31 12:27 .. -rwxrwxrwx 1 root root 2247 2007-10-27 17:47 attachmentread1.class.php -rwxrwxrwx 1 root root 3651 2007-10-28 00:09 attachmentread.class.php -rwxr-xr-x 1 postfix postfix 307 2007-10-28 17:50 email1.php -rwsr-sr-x 1 web7_techtest phpmyadmin 211 2007-10-28 18:01 email.php -rwxrwxrwx 1 root root 495 2007-10-28 23:56 readattachment.php -rw------- 1 root root 478 2007-10-29 02:43 readattachment.php.save drwxr-xr-x 2 root root 4096 2007-10-28 00:06 test -rw-r--r-- 1 root root 804 2007-10-28 00:19 test.php -rw-r--r-- 1 root root 23 2007-10-29 00:32 test.pl
Sorry ah sorry!!! total 44 drwxr-xr-x 3 root root 4096 2007-10-29 02:43 . drwxrwxrwx 11 root root 4096 2007-10-31 12:27 .. -rwxrwxrwx 1 root root 2247 2007-10-27 17:47 attachmentread1.class.php -rwxrwxrwx 1 root root 3651 2007-10-28 00:09 attachmentread.class.php -rwxr-xr-x 1 postfix postfix 307 2007-10-28 17:50 email1.php -rwsr-sr-x 1 web7_techtest phpmyadmin 211 2007-10-28 18:01 email.php -rwxrwxrwx 1 root root 495 2007-10-28 23:56 readattachment.php -rw------- 1 root root 478 2007-10-29 02:43 readattachment.php.save drwxr-xr-x 2 root root 4096 2007-10-28 00:06 test -rw-r--r-- 1 root root 804 2007-10-28 00:19 test.php -rw-r--r-- 1 root root 23 2007-10-29 00:32 test.pl
Looks ok. Do you get any errors when you run Code: /usr/bin/php /var/www/web7/web/network/email/email.php on the shell?