pipe email problem from php script

isputra

Well-Known Member
May 3, 2003
574
0
166
Mbelitar
Hi,

I have problem piping email from php script. I'am using

Code:
|/usr/bin/php -q /home/www/public_html/helpdesk/sources/pipe.php
but still fail with this message :

Code:
  pipe to |/usr/bin/php -q /home/www/public_html/helpdesk/sources/pipe.php
    generated by [email protected]
    local delivery failed
and looking at exim_mainlog found this :

Code:
2008-05-23 16:49:32 1JzTu0-00033y-BY ** |/usr/bin/php -q /home/www/public_html/helpdesk/sources/pipe.php ([email protected]) <[email protected]> R=virtual_aliases_nostar T=virtual_address_pipe: Child process of virtual_address_pipe transport returned 255 (could mean shell command ended by signal 127 (Unknown signal 127)) from command: /usr/bin/php
Even added #!/usr/bin/php -q at pipe.php but still not working

Anyone can help me ?

WHM 11.23.0 cPanel 11.23.1-C24775
CENTOS Enterprise 5 i686 on standard - WHM X v3.1.0
PHP 5.2.5 using suphp, suhosin, and zend.
Also Apache suEXEC is on
 
Last edited:

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Hi,

I have problem piping email from php script. I'am using

Code:
|/usr/bin/php -q /home/cyber/public_html/helpdesk/sources/pipe.php
but still fail with this message :

Code:
  pipe to |/usr/bin/php -q /home/www/public_html/helpdesk/sources/pipe.php
    generated by [email protected]
    local delivery failed
and looking at exim_mainlog found this :

Code:
2008-05-23 16:49:32 1JzTu0-00033y-BY ** |/usr/bin/php -q /home/www/public_html/helpdesk/sources/pipe.php ([email protected]) <[email protected]> R=virtual_aliases_nostar T=virtual_address_pipe: Child process of virtual_address_pipe transport returned 255 (could mean shell command ended by signal 127 (Unknown signal 127)) from command: /usr/bin/php
Even added #!/usr/bin/php -q at pipe.php but still not working

Anyone can help me ?

WHM 11.23.0 cPanel 11.23.1-C24775
CENTOS Enterprise 5 i686 on standard - WHM X v3.1.0
PHP 5.2.5 using suphp, suhosin, and zend.
Also Apache suEXEC is on
When you added that line to the script, did you set the pipe to just /home/cyber/public_html/helpdesk/sources/pipe.php instead and set the file to have executable permissions?
 

isputra

Well-Known Member
May 3, 2003
574
0
166
Mbelitar
When you added that line to the script, did you set the pipe to just /home/www/public_html/helpdesk/sources/pipe.php instead and set the file to have executable permissions?
Yes, the forwarder just :

|/home/www/public_html/helpdesk/sources/pipe.php
 

bpmod

Well-Known Member
Sep 23, 2004
49
0
156
The only way I've ever gotten this to work properly is as follows:

|/bin/sh -c '/usr/bin/php /path/to/your/script.php >> /path/to/an/outputfile.txt'

That is, pipe to the shell with the php binary and your script as arguments. I am not saying that the previous suggestions are not valid, only that this way will also work.

Hope it helps.

Brian

ETA: This may require the shell being enabled for the user in question. I have disabled shell access by default for all users, but have enabled it for trusted users (such as my own sites).
 
Last edited:

isputra

Well-Known Member
May 3, 2003
574
0
166
Mbelitar
The only way I've ever gotten this to work properly is as follows:

|/bin/sh -c '/usr/bin/php /path/to/your/script.php >> /path/to/an/outputfile.txt'

That is, pipe to the shell with the php binary and your script as arguments. I am not saying that the previous suggestions are not valid, only that this way will also work.

Hope it helps.

Brian

ETA: This may require the shell being enabled for the user in question. I have disabled shell access by default for all users, but have enabled it for trusted users (such as my own sites).
Should i put #!/usr/bin/php -q to the script or not ?
 

CaMer0n

Well-Known Member
Nov 8, 2004
57
0
156
I have the same problem.

"local delivery failed"

I have a similar script working on another machine (possibly added with X rather than X3).

Perhaps a bug was introduced recently?

I'm using:
WHM 11.15.0 cPanel 11.18.6-R24739
CENTOS Enterprise 4.6 i686 on standard
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
I have the same problem.

"local delivery failed"

I have a similar script working on another machine (possibly added with X rather than X3).

Perhaps a bug was introduced recently?

I'm using:
WHM 11.15.0 cPanel 11.18.6-R24739
CENTOS Enterprise 4.6 i686 on standard
With X, you manually put in the pipe character. With X3, you do not.
 

rhenderson

Well-Known Member
Apr 21, 2005
778
2
168
Oklahoma
cPanel Access Level
Root Administrator
With X, you manually put in the pipe character. With X3, you do not.
I tried in on X3 as described in the instructions, no luck, changed the theme to X put it in as it was needed there, it worked, switched back to X3 and all is fine.

An alternate way could be to make a execuatble script in the home directory portion as well.
 

isputra

Well-Known Member
May 3, 2003
574
0
166
Mbelitar
This is still problem to me. Change to X not solve my problem.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
If anyone is still having an issue with piping mail to a script, submit a support ticket: http://tickets.cpanel.net/submit

Our technical analysts will be able to determine why such functionality may not be working on your particular servers.

I know there is often much user-error with relation to this feature. However, given the course of discussion, it seems to be prudent to have a technical analyst take a look at things in case this isn't user error :).
 

docbreed

Well-Known Member
Jul 18, 2005
57
0
156
well Im having the same issue.. was working on my support program until a client raised the flag to me that it wasn't working. So whats the fix that i need to do for this downtime were involving???
 

docbreed

Well-Known Member
Jul 18, 2005
57
0
156
ok so i had it all working for who knows how long by using

|/usr/local/php4/bin/php -q /home/hostb/public_html/support/pipe/pipe.php

poking around i found out that iconcube .so was the problem for me so i switched to php5 bin instead and worked right away.. BTW I've had x3 working with above string forever.

|/usr/bin/php -q /home/hostb/public_html/support/pipe/pipe.php

This works for me now...