I have a montthly Blesta licens through buycpanel.com, and I'm having some problems getting the pipe and/or imap to work with my Blesta installation.  I've had the above errors as listed in email with certain config parameters, and I've tried 2 varitions of pipe.php; one gives simliar erros to above, the other has problems with the " . DIRECTORY_SEPARATOR . ".." statement.   I would open a ticket, but I'm not registered on Blesta to do so in buying thru a reseller.   Any help I can get resolving the issue is sincerely appreciated.  When I use BASH at the beginning of the php code (see below), with file chmode 755, I get the following errors (see below code). 
#!/usr/bin/php -q
<?php
try {
    include(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib/init.php");
    
    // Dispatch the Web request
    if (!empty($_SERVER['REQUEST_URI']))
        Dispatcher::dispatch($_SERVER['REQUEST_URI']);
    // Dispatch the CLI request
    else
        Dispatcher::dispatchCli($argv);
}
catch (Exception $e) {
    try {
        // Attempt to raise any error, gracefully
        Dispatcher::raiseError($e);
    }
    catch (Exception $e) {
        if (Configure::get("System.debug"))
            echo $e->getMessage() . " on line <strong>" . $e->getLine() .
                "</strong> in <strong>" . $e->getFile() . "</strong>\n" .
                "<br />Printing Stack Trace:<br />" . nl2br($e->getTraceAsString());
        else
            echo $e->getMessage();
    }
}
?>
PROCUCED THE FOLLOWING  BOUNCED EMAIL BACK WITH ERRORS:   
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 |/home/admin/public_html/ 
store/plugins/support_manager/pipe.php plugin/support_manager/ticket_pipe/index/1/     generated by SALES@DOMAIN.CA     local delivery failed  The following text was generated during the delivery attempt:  ------ pipe to |/home/admin/public_html/store/plugins/support_manager/pipe.php plugin/support_manager/ticket_pipe/index/1/        generated by sales@albertahost.ca ------  /home/admin/public_html/store/plugins/support_manager/pipe.php: line 2: ?php: No such file or directory /home/admin/public_html/store/plugins/support_manager/pipe.php: line 3: try: command not found /home/admin/public_html/store/plugins/support_manager/pipe.php: line 4: syntax error near unexpected token `dirname' /home/admin/public_html/store/plugins/support_manager/pipe.php: line 4: `       include(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib/init.php");'  ------ This is a copy of the message, including all the headers. ------
  
  
  
  
  
THEN, 
  
 If I use this code layout for pipe.php, with chmod 755   
<?php
try {
    include(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib/init.php");
    
    // Dispatch the Web request
    if (!empty($_SERVER['REQUEST_URI']))
        Dispatcher::dispatch($_SERVER['REQUEST_URI']);
    // Dispatch the CLI request
    else
        Dispatcher::dispatchCli($argv);
}
catch (Exception $e) {
    try {
        // Attempt to raise any error, gracefully
        Dispatcher::raiseError($e);
    }
    catch (Exception $e) {
        if (Configure::get("System.debug"))
            echo $e->getMessage() . " on line <strong>" . $e->getLine() .
                "</strong> in <strong>" . $e->getFile() . "</strong>\n" .
                "<br />Printing Stack Trace:<br />" . nl2br($e->getTraceAsString());
        else
            echo $e->getMessage();
    }
}
?>
 Produced the following BOUNCED ERRORS::  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 |/home/admin/public_html/ 
  
store/plugins/support_manager/pipe.php plugin/support_manager/ticket_pipe/index/1/     generated by SALES@DOMAIN.CA     local delivery failed  ------ This is a copy of the message, including all the headers. ------
I'm close, but it's not working, I"m missing something.  I've been chasing this around for a coupld days -  I would like to get it resolved. Would appreciate any insight I can gain on my errors.   If you need access to check it out, let me know. you can email me at  albertahost (at) gmail {dot} com and I can give you the logins you need (blesta, cpanel, whm?).  -Scott