I can’t seem to get this one to work and it is boggling my brain… What I’m trying to so is as the subject says, trying to pipe and email to a php script that is designed to take the email information and process it.
In the email aliases field I have selected the email alias “support” and configured the “Feed to program” setting with “/home/domain.com/public_html/test.php”. To test I have created a test.php file that emails me once the script has been executed. So I send an email to support@domain.com and get this in the logs:
I’ve tried all manor of permissions variations, but nothing…
When I do a “php -q /home/domain.com/public_html/test.php” , the test script I get the script output and an email in my inbox, so I know the script is working.
Somehow I think php needs to be piped to and the pipe data passed onto the script. Everywhere I look there is no mention of this.
Thanks or the reply. Tried that and get the output:
“support-domain.com@domain.com (expanded from support@domain.com): Command died with status 1: “php -q
/home/domain.com/public_html/test.php”. Command
output: Could not open input file:
/home/domain.com/public_html/test.php”
Okay, first thing I’d do is run a “chmod 755” on that script – I understand you were just troubleshooting, but it definitely doesn’t need to be 777, and you don’t want random people being able to edit that
Second –
While this shouldn’t be an issue, as procmail should be running as your username here – perhaps we can try this as an experiment.
If you were to make the directories leading up to your script executable, you could rule out an odd permissions issue… something like:
That worked! The main script I’m working with is encoded with sourceguardian and doesn’t seem to be doing anything, but my test script took the pipe stdin of the email and emailed the contents to another address, so I know that it’s working…
I did a few other tests, only to find that when an email is piped to a file the user and group is set to nobody:nobody… Can that be set per user? Seems a bit odd to me as permissions would need to be very lax if I was to save emails into a users directory…
I know this post is getting old, but just wanted to acknowledge that after struggling with getting email piping to work for a whole day, stumbling across this old post and following this suggestion:
If you are trying to save some time you might consider using a hosted service for the email piping. Another reason this can be helpful is that it handles the email parsing as well. You might checkout (free) http://mailhooks.com or (premium) http://mailnuggets.com to speed things up.
Command died with status 1: “php -q /home/mydomain/public_html/admin/pipe/pipe.php”.
Command output: Could not open input file: /home/mydomain/public_html/admin/pipe/pipe.php
Hello,
I followed the tips suggested above, but the alias doesn’t send or better the pipe.php was not executed,
if I run the script in terminal php -q /home/mydomain/public_html/admin/pipe/pipe.php
I have Site error: the file xxxx need ioncube loader…bla bla bla
Whmcs have been installed by Virtualmin, ioncube is loaded, the file .so is in the folders…
is wrote right ?
Or Virtualmin doesn’t accept the string because want it write differently , or for what ??
The pipe setting is for the Whmcs Ticket System
in “Feed to Program” I have the error, as I told you, I have simply modified the string adding the custom php, adding “PHPRC=/home/mydomain/etc/php5” cause the error,
if I write only “php -q /home/mydomain/public_html/admin/pipe/pipe.php” that string is accepted, but not well executed, the email sender receive an error from the mail server “Command output: Could not open input file: /home/mydomain/public_html/admin/pipe/pipe.php”
I have tried to add in the main php.ini the reference to ioncube, but I receive an ioncube error when I execute the script.
If I try to run in terminal, “PHPRC=/home/mydomain/etc/php5 php -q /home/mydomain/public_html/admin/pipe/pipe.php”, I receive this error:
PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/mcrypt.so’ - /usr/lib64/php/modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0