I’m trying to setup an email pipe so if someone sends an email to a particular address, a support ticket is created. I’m getting an error here when I send the email, I get bounce email back with error
Command died with status 1: "php
/home/domain/public_html/inc/ticket-receiver.php". Command output: Could
not open input file: /home/domain/public_html/inc/ticket-receiver.php
I’ve read many related thread on this but none helped me out. Here’s how I have setup my email piping. I have created an alias ticket-receiver@domain.com, in Advance tab I selected “Feed to Program” and the command I entered is
php /home/domain/public_html/inc/ticket-receiver.php
also tried /user/bin/php /home/domain/public_html/inc/ticket-receiver.php
The php file for now just contains the following code which is not executing:
<?php
require __DIR__.'/config.php';
$stdin = fopen('php://stdin', 'r');
$temp = '';
while($line = fgets($stdin)) {
$temp .= $line;
}
writeToLog($temp); //writes a string into a particular file
Update: I’ve moved the file into /home/domain/ directory and I removed the require function as it was giving me permission denied error. This is how the file looks now
After a lot of digging I’m pretty sure Postfix is the one who needs permission to execute my file. Perhaps this answer will solve my problem if I’m able to understand it but should I mess with the config file? Shouldn’t virtualmin handle all this?
No thats not the issue. It has to do something with the postfix configuration for virtualmin servers. It needs the proper configuration for aliases and db but I lack any functioning knowledge there myself. I was expecting virtualmin to make all the configuration changes automatically but its not.
Maybe someone from your team knows this stuff? All similar posts in the forums are 10 years old.