Jump to content
  • 0

Email Piping


MemoryX2

Question

Is anyone else having issues with email piping? This is a big pita. Everything I do on Blesta works great but email piping. I get it to sorta work, and then with every upgrade it no longer pipes. I did read this page: http://docs.blesta.com/display/user/Support+Manager#SupportManager-EmailPiping I've fixed up the program with hasbangs and executables etc. 

 

I would love to see this so that in the future it works and I'm not wondering if my emails are coming through or not..

 

 

My issue is that emails are not piped into the system, and if I ever get the emails piping into the system then the next upgrade breaks it again.

 

 

 

I'm using:

 

Blesta 3.0.2

cPanel 11.38.2

centos

php 5.3.26

 

 

Link to comment
Share on other sites

Recommended Posts

  • 0

I don't use Blesta on cPanel but I'm going to give this a shot until someone else has a better solution. 

 

If it's only occurring after a Blesta upgrade then you probably are not getting an email bounce message when you send an email to the piped address right?   Have you checked logs for PHP errors?  I'm not sure cPanel stores them but if you can produce those that's where I would start.  Also when you're placing the files and upgrading does it by any chance change any file permissions or ownership?  Unless it's something internal to Blesta that is the only thing that immediately comes to mind.

Link to comment
Share on other sites

  • 0
I don't use Blesta on cPanel but I'm going to give this a shot until someone else has a better solution. 

 

If it's only occurring after a Blesta upgrade then you probably are not getting an email bounce message when you send an email to the piped address right?   Have you checked logs for PHP errors?  I'm not sure cPanel stores them but if you can produce those that's where I would start.  Also when you're placing the files and upgrading does it by any chance change any file permissions or ownership?  Unless it's something internal to Blesta that is the only thing that immediately comes to mind.

WHMCS piping worked every time, no problem.

Link to comment
Share on other sites

  • 0

If cPanel is modifying the index.php file to include the hashbang, then this would explain why it stops working after an upgrade. We created a second piping method, which was to pipe.php per the documentation and that file comes with a hashbang in it, however people have experienced similar issues with that. 

 

This works fine when manually configured on Postfix and Sendmail systems per our testing, however cPanel tries to over simplify and restrict what you can do by not allowing you to include the path to PHP in the command, thus requiring the hashbang.

 

pipe.php was suppose to solve this, but ultimately, we may need to make a tweak to change the way arguments are passed in, namely the company ID. I suspect there may be an issue here with the pipe.php method. I'll discuss this with Cody in more detail on Monday.

Link to comment
Share on other sites

  • 0
If cPanel is modifying the index.php file to include the hashbang, then this would explain why it stops working after an upgrade. We created a second piping method, which was to pipe.php per the documentation and that file comes with a hashbang in it, however people have experienced similar issues with that. 

 

This works fine when manually configured on Postfix and Sendmail systems per our testing, however cPanel tries to over simplify and restrict what you can do by not allowing you to include the path to PHP in the command, thus requiring the hashbang.

 

pipe.php was suppose to solve this, but ultimately, we may need to make a tweak to change the way arguments are passed in, namely the company ID. I suspect there may be an issue here with the pipe.php method. I'll discuss this with Cody in more detail on Monday.

I would really like to see this fixed. I can give you free access to a cpanel account and everything. But it would be great to have this fixed..

I understand that cpanel is most likely the problem here, but I'm by far not the only person using it so if it worked that would help y'all too.

Link to comment
Share on other sites

  • 0

I would really like to see this fixed. I can give you free access to a cpanel account and everything. But it would be great to have this fixed.. I understand that cpanel is most likely the problem here, but I'm by far not the only person using it so if it worked that would help y'all too.

 

Thanks for the offer, though we do have a cPanel server we can test it on. I'll see what we can do.

Link to comment
Share on other sites

  • 0

The issue here that we've seen with cPanel is cPanel's inability to pass parameters along in a pipe request. Because of this, Blesta never receives the company ID that is to be processed for the request and thus can't process the request.

 

We're looking at possible work arounds, and unfortunately so far it looks like this would require a separate pipe script for each and every company you wish to pipe mail for, which is pretty crappy.

 

Would be great if cPanel added support for parameters in pipe requests as that would completely solve the issue without any change required in Blesta.

Link to comment
Share on other sites

  • 0

The issue here that we've seen with cPanel is cPanel's inability to pass parameters along in a pipe request. Because of this, Blesta never receives the company ID that is to be processed for the request and thus can't process the request.

 

We're looking at possible work arounds, and unfortunately so far it looks like this would require a separate pipe script for each and every company you wish to pipe mail for, which is pretty crappy.

 

Would be great if cPanel added support for parameters in pipe requests as that would completely solve the issue without any change required in Blesta.

 

Could we create a .php file, that contains a configurable option for the company ID in the file? We'll default this to "1" for the primary company. If users want to pipe email into multiple companies, they could copy the file, change the company ID, and pipe their mail into the cloned file.

 

We'll continue to support the other option by passing as parameters, but anyone that has trouble with that can use the alternative method.

Link to comment
Share on other sites

  • 0

Could we create a .php file, that contains a configurable option for the company ID in the file? We'll default this to "1" for the primary company. If users want to pipe email into multiple companies, they could copy the file, change the company ID, and pipe their mail into the cloned file.

 

We'll continue to support the other option by passing as parameters, but anyone that has trouble with that can use the alternative method.

 

I think that can be done simply by modifying pipe.php to include the proper set of parameters (missing from cPanel):

 

#!/usr/bin/php -q
<?php
try {
    include(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib/init.php");

 

becomes:

 

#!/usr/bin/php -q
<?php
try {
    include(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib/init.php");
    
    $argv = array(
        '/plugin/support_manager/ticket_pipe/index/1'
    );

 

But that has to be customized per company and per server (to include or not include /index.php/ in the path).

Link to comment
Share on other sites

  • 0

I think that can be done simply by modifying pipe.php to include the proper set of parameters (missing from cPanel):

#!/usr/bin/php -q
<?php
try {
    include(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib/init.php");

becomes:

#!/usr/bin/php -q
<?php
try {
    include(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib/init.php");
    
    $argv = array(
        '/plugin/support_manager/ticket_pipe/index/1'
    );

But that has to be customized per company and per server (to include or not include /index.php/ in the path).

I am using one company at the moment so if that will work I'm will to sacrifice the multi company functionality.

The question for me is, what is I create a new php file like pipemod.php that won't be overwritten on every update and put the exact same code in it as pipe.php along with the mentioned code changes then I send all of my emails to pipemod.php will that work?

The goal here is for it work before and after an update. If its not multi company I don't care I just need it to work and not worry about it.

Link to comment
Share on other sites

  • 0

I am using one company at the moment so if that will work I'm will to sacrifice the multi company functionality.

The question for me is, what is I create a new php file like pipemod.php that won't be overwritten on every update and put the exact same code in it as pipe.php along with the mentioned code changes then I send all of my emails to pipemod.php will that work?

The goal here is for it work before and after an update. If its not multi company I don't care I just need it to work and not worry about it.

 

Copy pipe.php and name is pipe1.php (1 for company ID 1, in the future if/when you add additional companies you can create a pipe2.php, etc.), then make the above changes to pipe1.php. Blesta won't overwrite any files it doesn't itself contain, so there should be no problem there.

 

Also, disclaimer, I haven't verified the above change works though theoretically it should.

Link to comment
Share on other sites

  • 0

Copy pipe.php and name is pipe1.php (1 for company ID 1, in the future if/when you add additional companies you can create a pipe2.php, etc.), then make the above changes to pipe1.php. Blesta won't overwrite any files it doesn't itself contain, so there should be no problem there.

 

Also, disclaimer, I haven't verified the above change works though theoretically it should.

 

 

I'm getting replys that contain this:

 

<!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="/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>session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent on line <strong>170</strong> in <strong>/home/kyle1992/public_html/members/components/session/session.php</strong></p>
        </div>
    </div>    </body>
</html><br />
<b>Fatal error</b>:  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, Array)
#1 {main}
  thrown in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>:  Invalid callback Session::sessionClose, cannot access private method Session::sessionClose() in <b>Unknown</b> on line <b>0</b><br />

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

 

My ticket received mail template is :

<p>
	We have received your request and someone will be looking at it shortly.</p>

So I don't think my template is the error.

Link to comment
Share on other sites

  • 0
The command to http://docs.blesta.com/display/user/Support+Manager#SupportManager-EmailPiping'>pipe messages from your server. What does it look like?

|/home/username/public_html/members/plugins/support_manager/pipmod.php

Pipmod is the previously mentioned pipe1 modification. It contains the exact code as pipe.php except with the previously noted changes. The permissions are 744 because if I use 644 I get an email response saying unable to execute the file.

Link to comment
Share on other sites

  • 0

|/home/username/public_html/members/plugins/support_manager/pipmod.php Pipmod is the previously mentioned pipe1 modification. It contains the exact code as pipe.php except with the previously noted changes. The permissions are 744 because if I use 644 I get an email response saying unable to execute the file.

 

Try the pipmod.php in the root? /home/username/public_html/pipmod.php

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...