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.

Email piping works but resulting in bounced failure message to sender

Discussion in 'E-mail Discussions' started by s_mack, Jan 23, 2011.

  1. s_mack

    s_mack Registered

    Joined:
    Dec 11, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Vancouver, BC Canada
    I'm trying to add a pipe-to-program filter for email in cPanel. It actually works perfectly, except that the sender gets a failure notice bounce. I've seen similar posts by people and it always seems to be relating to some PHP error, but in my case no such error is given... just a "report" of what happened. Any ideas on how I can prevent the bounce? Here's the complete bounced message (with identifying areas changed):

    Thanks

    -Steven
     
  2. jntcm

    jntcm Registered

    Joined:
    Nov 29, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    A year late, but better late than never...

    If you're getting an empty bounce back like this:

    he following text was generated during the delivery attempt:

    ------ pipe to |/home/xxxxxx/public_html/tkt/pipe.php
    generated by xxx@xxx.aq ------



    ------ This is a copy of the message, including all the headers. ------

    You need to make sure that the first line of your script correctly tells where PHP is:

    #!/usr/local/bin/php -q

    Secondly, make sure your script is not outputting ANYTHING at all, anywhere, ever.

    A common mistake is this:

    #!/usr/local/bin/php -q

    <?
    //Php Code here...

    See the blank line between the "#!" line and the "<?"... Yeah, that'll do it.

    Happy coding!
     
  3. s_mack

    s_mack Registered

    Joined:
    Dec 11, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Vancouver, BC Canada
    Lol... thanks. I don't even remember what I was trying to do at that time.
     
  4. webstro

    webstro Member

    Joined:
    Mar 2, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    To follow up on this, I was having the same problem.

    Difficult to debug because it seemed there was no real error.

    Although I didn't have a space between the shebang and the <?php, I was still getting the error.

    It turned out that there cannot be any blank lines, ANYWHERE, in the script.

    I also removed any blank spaces at the end of lines, although I'm not sure that mattered. It works!
     
  5. webstro

    webstro Member

    Joined:
    Mar 2, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    To clarify, my original pipe.php script:

    Code:
    #!/usr/local/bin/php -q
    <?php
    
    //do something
    code;
    
    // something else
    code;
    
    ?>
    FAILED.

    The updated script:

    Code:
    #!/usr/local/bin/php -q
    <?php
    //do something
    code;
    // something else
    code;
    ?>
    WORKED.
     
Loading...

Share This Page