Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2003
    Location
    Vancouver, BC Canada
    Posts
    2

    Default Email piping works but resulting in bounced failure message to sender

    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):

    This message was created automatically by mail delivery software.

    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:

    pipe to |/usr/bin/php -q /home/critical/public_html/cgi-bin/pipetest.php
    generated by recipient@replacedwithfakedomain.com

    The following text was generated during the delivery attempt:

    ------ pipe to |/usr/bin/php -q /home/critical/public_html/cgi-bin/pipetest.php
    generated by recipient@replacedwithfakedomain.com ------



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

    Return-path: <sender@anotherfakedomain.com>
    Received: from idcmail-mo1so.anotherfakedomain.com ([xx.xx.xx.xx])
    by SouthBend-84.pgzn.com with esmtp (Exim 4.69)
    (envelope-from <sender@anotherfakedomain.com>)
    id 1Ph7Cy-0006kM-OB
    for recipient@replacedwithfakedomain.com; Sun, 23 Jan 2011 16:10:50 -0500
    Received: from pd2ml1so-ssvc.prod.anotherfakedomain.com ([xx.xx.xx.xx])
    by pd2mo1so-svcs.prod.anotherfakedomain.com with ESMTP; 23 Jan 2011 14:04:51 -0700
    X-Cloudmark-SP-Filtered: true
    X-Cloudmark-SP-Result: v=1.1 cv=6EkEX6JM2LCztCEhkE317K9SpBSN4cB8nbuuHVfFIzI= c=1 sm=1
    a=BLceEmwcHowA:10 a=8nJEP1OIZ-IA:10 a=a8Ng+qwsTi9bQXyB64v8wA==:17
    a=nS36O97Bj3wUElCrIrAA:9 a=WSUfejPYnVaDIwHsvJh5HpFP3bwA:4 a=wPNLvfGTeEIA:10
    a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
    Received: from unknown (HELO [192.168.144.100]) ([xx.xx.xx.xx])
    by pd2ml1so-dmz.prod.anotherfakedomain.com with ESMTP; 23 Jan 2011 14:04:51 -0700
    Message-ID: <4D3C97F3.3070907@anotherfakedomain.com>
    Date: Sun, 23 Jan 2011 13:04:51 -0800
    From: Fake person <sender@anotherfakedomain.com>
    Reply-To: sender@anotherfakedomain.com
    Organization: FakeOrg
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 ThunderBrowse/3.3.4
    MIME-Version: 1.0
    To: recipient@replacedwithfakedomain.com
    Subject: test 2
    Content-Type: text/plain; charset=ISO-8859-1; format=flowed
    Content-Transfer-Encoding: 7bit
    X-Spam-Status: No, score=-0.2
    X-Spam-Score: -1
    X-Spam-Bar: /
    X-Ham-Report: Spam detection software, running on the system "ThisIsMyHost.com", has
    identified this incoming email as possible spam. The original message
    has been attached to this so you can view it (if it isn't spam) or label
    similar future email. If you have any questions, see
    the administrator of that system for details.
    Content preview: test [...]
    Content analysis details: (-0.2 points, 5.0 required)
    pts rule name description
    ---- ---------------------- --------------------------------------------------
    -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at dnswl.org - Protect against false positives, low
    trust
    [xx.xx.xx.xx listed in list.dnswl.org]
    -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay
    domain
    -0.0 SPF_PASS SPF: sender matches SPF record
    -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
    [score: 0.0000]
    1.7 AWL AWL: From: address is in the auto white-list
    X-Spam-Flag: NO

    test
    Thanks

    -Steven

  2. #2
    Registered User
    Join Date
    Nov 2011
    Posts
    1
    cPanel/Enkompass Access Level

    DataCenter Provider

    Cool Re: Email piping works but resulting in bounced failure message to sender

    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. #3
    Registered User
    Join Date
    Dec 2003
    Location
    Vancouver, BC Canada
    Posts
    2

    Default Re: Email piping works but resulting in bounced failure message to sender

    Lol... thanks. I don't even remember what I was trying to do at that time.

  4. #4
    Member
    Join Date
    Mar 2004
    Posts
    10

    Default Re: Email piping works but resulting in bounced failure message to sender

    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. #5
    Member
    Join Date
    Mar 2004
    Posts
    10

    Default Re: Email piping works but resulting in bounced failure message to sender

    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.

Similar Threads & Tags
Similar threads

  1. Email Piping to script works, but sender gets an error message?
    By itzhero in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 11-24-2010, 12:50 PM
  2. Replies: 1
    Last Post: 03-06-2010, 11:24 PM
  3. piping works but creates a mail undeliverable message
    By betoranaldi in forum E-mail Discussions
    Replies: 2
    Last Post: 12-26-2008, 11:30 AM
  4. Email pipe works | Sender still gets error message
    By nybble in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 11-23-2004, 01:32 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube