I've installed sendmail and want to pipe incoming emails to php.
Every time I send an email to my server I am getting an email back with an error message:
could not open input file: /root/fw/catcher.php 554 5.3.0 unknown mailer error 1
I think something with the permissions of catcher.php
is wrong but I couldn't figure it out by myself.
Sendmail is installed and I have added an alias:
root: "|/usr/bin/php /root/fw/catcher.php"
Permissions (after chmod 777
; I tried chmod 777
and chmod 755
but both won't work):
drwxrwxrwx 2 root root 4096 Jul 20 14:27 fw
-rwxrwxrwx 1 root root 45 Jul 20 14:27 catcher.php
catcher.php (converted line endings to Unix style):
#!/usr/bin/php
<?php echo 'Test'; exit(0); ?>
Executing my php file over cli works fine. All of these commands work:
/usr/bin/php /root/fw/catcher.php
/usr/bin/php7.3 /root/fw/catcher.php
php /root/fw/catcher.php
php7.3 /root/fw/catcher.php
I think there is a problem with the permissions of sendmail.