Jump to content
  • 0

Can't get ticket piping to work


sunrisepro

Question

I'm having trouble setting up the forwarder in cPanel as nothing seems to work. I tried both

/usr/bin/php /home/username/public_html/blesta/plugins/support_manager/pipe.php
/usr/local/bin/php /home/username/public_html/blesta/plugins/support_manager/pipe.php

Blesta is in a subfolder named 'Blesta'. The error message I get is

Action: failed
Final-Recipient: rfc822;|/home/USERNAME/usr/local/bin/php /home/USERNAME/public_html/blesta/plugins/support_manager/pipe.php
Status: 5.0.0

The path to pipe.php is correct - what else could be wrong? I also checked with my host & confirmed that Mailparse is installed & active.

Link to comment
Share on other sites

Recommended Posts

  • 0
16 minutes ago, sunrisepro said:

I'm having trouble setting up the forwarder in cPanel as nothing seems to work. I tried both

/usr/bin/php /home/username/public_html/blesta/plugins/support_manager/pipe.php
/usr/local/bin/php /home/username/public_html/blesta/plugins/support_manager/pipe.php

Blesta is in a subfolder named 'Blesta'. The error message I get is


Action: failed
Final-Recipient: rfc822;|/home/USERNAME/usr/local/bin/php /home/USERNAME/public_html/blesta/plugins/support_manager/pipe.php
Status: 5.0.0

The path to pipe.php is correct - what else could be wrong? I also checked with my host & confirmed that Mailparse is installed & active.

It looks like cPanel is pre-pending the path to your home directory to restrict where you can pipe email. Make sure the 1st line in pipe.php is a hashbang to your PHP binary, and remove that part from your forwarder.

#!/usr/local/bin/php

Then pipe to /home/username/public_html/blesta/plugins/support_manager/pipe.php

Link to comment
Share on other sites

  • 0

Nope - here's the email error:

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/username/public_html/blesta/plugins/support_manager/pipe.php
    generated by support@email.com
    local delivery failed

Action: failed
Final-Recipient: rfc822;|/home/username/public_html/blesta/plugins/support_manager/pipe.php
Status: 5.0.0

 

Link to comment
Share on other sites

  • 0

Here's the last error message:

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/username/public_html/blesta/plugins/support_manager/pipe.php plugin/support_manager/ticket_pipe/index/1/

Action: failed
Final-Recipient: rfc822;|/home/username/public_html/blesta/plugins/support_manager/pipe.php plugin/support_manager/ticket_pipe/index/1/
Status: 5.0.0

 

Link to comment
Share on other sites

  • 0
3 hours ago, sunrisepro said:

There appears to be a hashbang already at the beginning of pipe.php:


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

Is that alright? And when I create the forwarder piping to , it becomes


|/home/username/home/username/public_html/blesta/plugins/support_manager/pipe.php

I'm going to remove 'home/username' from the forward & test it.

This is probably correct, minus the /home/username. Is the file executable? chmod +x pipe.php or 755.

Link to comment
Share on other sites

  • 0

It was 744, just made it 755. Still not working:

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/username/public_html/blesta/plugins/support_manager/pipe.php
    generated by support@email.com
    local delivery failed

Action: failed
Final-Recipient: rfc822;|/home/username/public_html/blesta/plugins/support_manager/pipe.php
Status: 5.0.0

 

Link to comment
Share on other sites

  • 0

Do you have SSH access? Is mailparse included in the CLI version of PHP? To find out, you can run the following via SSH:

php -i | grep mailparse

The next thing you could do is send yourself an email, and view the source including the headers. Copy this to a text file called something like email.txt, and replace the TO address with that of your ticket email address.

/home/username/public_html/blesta/plugins/support_manager/pipe.php < /path/to/email.txt

This will send the content of email.txt to pipe.php for processing. This is a simple way to test by bypassing the mail server.

Link to comment
Share on other sites

  • 0
10 minutes ago, sunrisepro said:

I don't have the time to enable & setup SSH access right now, and I have no idea what the 'CLI version of PHP' even means.

Aside from SSH, what do you think is the problem?

There is some kind of error. The only thing I can think of, is that it's missing the mailparse dependency. The other steps help you determine that, and also debug to rule out the mail server being the issue by manually piping an email from text file to the application.

Link to comment
Share on other sites

  • 0
Quote

Yes, the Mailparse extension is enabled for all cPanel accounts on your server.

It is also enabled for PHP-CLI (again on all accounts):
 

Code:
username@server [~]# echo "<?php phpinfo(); ?>" | /usr/local/bin/php | grep -i mailparse
mailparse
mailparse support => enabled
mailparse.def_charset => us-ascii => us-ascii

 

Does that help?

Link to comment
Share on other sites

  • 0
19 hours ago, sunrisepro said:

Does that help?

Yes, it appears that mailparse is in your PHP CLI environment, great! Unfortunately that doesn't get us any closer to determining the issue. What you can do is enable error reporting. An error may occur in the bounce message, but would definitely appear if you tried to pipe a text file email to pipe.php via SSH.

To enable error reporting, edit /config/blesta.php and change
 
Configure::errorReporting(0);

to
 
Configure::errorReporting(-1);

If running Blesta 3.6.2, also change 

Configure::set("System.debug", false);

to

Configure::set("System.debug", true);
19 hours ago, evolvewh said:

Use 700 for the pipe.php file permission, make sure the hashbang is included and you should be all set.

Did that work for you on cPanel?

Link to comment
Share on other sites

  • 0

Here's the new error in the returned mail:

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/username/public_html/blesta/plugins/support_manager/pipe.php
    generated by support@mail.com
    local delivery failed

The following text was generated during the delivery attempt:

------ pipe to |/home/username/public_html/blesta/plugins/support_manager/pipe.php
       generated by support@email.com ------

PHP Fatal error:  Call to undefined function mailparse_msg_create() in /home/username/public_html/blesta/plugins/support_manager/vendors/mime_mail_parser/MimeMailParser.class.php on line 113

Fatal error: Call to undefined function mailparse_msg_create() in /home/username/public_html/blesta/plugins/support_manager/vendors/mime_mail_parser/MimeMailParser.class.php on line 113
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us" dir="ltr">
        <head>
                <title>Blesta</title>
                <link rel="stylesheet" type="text/css" href="/home/username/public_html/blesta/plugins/support_manager/app/views/errors/css/styles.css" />
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        </head>

        <body>
                        <div class="program_error">
                <h3>Oh noes!</h3>
                <div class="contents">
                        <p>Call to undefined function mailparse_msg_create() on line <strong>113</strong> in <strong>/home/username/public_html/blesta/plugins/support_manager/vendors/mime_mail_parser/MimeMailParser.class.php</strong></p>
                </div>
        </div>  </body>
</html>PHP Fatal error:  Uncaught exception 'UnknownException' with message 'Invalid callback Session::sessionWrite, cannot access private method Session::sessionWrite()' in Unknown:0
Stack trace:
#0 [internal function]: UnknownException::setErrorHandler(2, 'Invalid callbac...', 'Unknown', 0, NULL)
#1 {main}
  thrown in Unknown on line 0

Fatal error: Uncaught exception 'UnknownException' with message 'Invalid callback Session::sessionWrite, cannot access private method Session::sessionWrite()' in Unknown:0
Stack trace:
#0 [internal function]: UnknownException::setErrorHandler(2, 'Invalid callbac...', 'Unknown', 0, NULL)
#1 {main}
  thrown in Unknown on line 0
PHP Warning:  Invalid callback Session::sessionClose, cannot access private method Session::sessionClose() in Unknown on line 0

Warning: Invalid callback Session::sessionClose, cannot access private method Session::sessionClose() in Unknown on line 0

Action: failed
Final-Recipient: rfc822;|/home/username/public_html/blesta/plugins/support_manager/pipe.php
Status: 5.0.0

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...