Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Cpanel 11 can't Pipe to script for email forwarding

Discussion in 'E-mail Discussion' started by rfresh, Mar 12, 2008.

  1. rfresh

    rfresh Registered

    Jan 29, 2004
    Likes Received:
    Trophy Points:
    I'm using cPanel 11 on my website. I'm trying to create one forwarding email account ( to pipe into a php script but the pipe isn't calling the script.

    Here is my forwarding/piping syntax: to |/home/websitename/public_html/SMS.php

    The script is set to 755.

    I have other, regular forwards created and mail gets forwarded fine such as for sales, info, etc. to my hotmail account.

    Here is the simple test script:

    mail('', 'Subject', 'Message', 'From:');

    The script works if I run it from a browser and it works if I run it from the command line in SSH - that is, I get the email message.

    It just doesn't execute when the email comes in addressed to and piped into this script.

    I have other php scripts successfully using the mail() function so that is enabled on the server.

    Since the script works from two sources and not as being piped from an incoming email, I suspect the problem is in the piping syntax.

    I've discovered that the following syntax will work:

    /usr/local/bin/php /home/mywebsite/public_html/SMS.php

    but in cpanel ver 11, it strips out the first part (the php is located here). I was able to get this to work at my shared hosting provider but at my vps hosting provider they are using cpanel 11 and it won't take the string without stripping out the first part thus the piping won't work. Adding the hashbang in the script doesn't make it work.

    Is there a workaround for this in cpanel 11?

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice