The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

pipe email problem from php script

Discussion in 'E-mail Discussions' started by isputra, May 23, 2008.

  1. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    576
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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 support@domain.net
        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 (support@domain.net) <support@domain.net> 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
     
    #1 isputra, May 23, 2008
    Last edited: May 23, 2008
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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?
     
  3. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    576
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Mbelitar
    Yes, the forwarder just :

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

    bpmod Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    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).
     
    #4 bpmod, May 26, 2008
    Last edited: May 26, 2008
  5. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    I ran into this recently as well. I found if I changed to X theme, set up the piping then it worked, when I changed back to X3 theme it still worked. Just wierd I guess.
     
  6. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    576
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Mbelitar
    Should i put #!/usr/bin/php -q to the script or not ?
     
  7. CaMer0n

    CaMer0n Well-Known Member

    Joined:
    Nov 8, 2004
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    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
     
  8. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    All I know is they defintely handle it differently now.
     
  9. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    With X, you manually put in the pipe character. With X3, you do not.
     
  10. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    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.
     
  11. CaMer0n

    CaMer0n Well-Known Member

    Joined:
    Nov 8, 2004
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    well, I'm not sure what happened, but I managed to get it to work, while using X3.
    The only difference I can see is that I created another fowarder with a pipe, and then recreated my original email forwarder with it's pipe.
    Then it started to work.
     
  12. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    576
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Mbelitar
    This is still problem to me. Change to X not solve my problem.
     
  13. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    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 :).
     
  14. docbreed

    docbreed Well-Known Member

    Joined:
    Jul 18, 2005
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    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???
     
  15. docbreed

    docbreed Well-Known Member

    Joined:
    Jul 18, 2005
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    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...
     
Loading...

Share This Page