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

Can't get it working :l

 

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/pipe2.php plugin/support_manager/ticket_pipe/index/2
    generated by support@licensecart.com
    local delivery failed

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

Return-path: <cubicwebs@gmail.com>
Received: from mail-lb0-f182.google.com ([209.85.217.182]:44716)
        by cubic2.cubicwebs.com with esmtps (TLSv1:RC4-SHA:128)
        (Exim 4.80.1)
        (envelope-from <cubicwebs@gmail.com>)
        id 1VMjJg-0005pT-4u
        for support@licensecart.com; Thu, 19 Sep 2013 19:51:04 +0100
Received: by mail-lb0-f182.google.com with SMTP id c11so8235363lbj.13
        for <support@licensecart.com>; Thu, 19 Sep 2013 11:51:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type;
        bh=LIJadzvNxr3fp/JxVfq7L/+8nHXtW5vUWQBxgRyKF3c=;
        b=xJqh425ugflI208KWhlT/xVM3YpdMGI+sJfh1TogZLMkOKs5PwBxCquhWQ/5ZbHiUv
         1Bi3xCKBk0n83jgqqJYAcvzohjGhSaImFhC8UG+UsB9uizfFFtxIa3GUuyIoq/Cj1Mqj
         FkAMRhH7DRSyX16o2g+6uW9/sWGsBvGXt0f0cQE+0QAOdYeQNvqKos3p3vnJu6qnQrcL
         TENIBacSHCrLBp4SekZt7j0drgm6cTT+jdd5Fu+H+q79w5TxL+wXuhz891lPR8yDsv/Y
         txfXK0sQ+rNsuQ45nCGEnqzORlted8KF2ZT6zSKqvhbgmGmqZwMzLKQNJKcdknDL+2n+
         /KXw==
MIME-Version: 1.0
X-Received: by 10.112.52.225 with SMTP id w1mr2788627lbo.31.1379616662648;
 Thu, 19 Sep 2013 11:51:02 -0700 (PDT)
Received: by 10.112.181.196 with HTTP; Thu, 19 Sep 2013 11:51:02 -0700 (PDT)
Date: Thu, 19 Sep 2013 19:51:02 +0100
Message-ID: <CAFg25KGhtTPfqo25H7r60vo7tCc-=AorceWarzq_3F6XEukfvg@mail.gmail.com>
Subject: TESTInG
From: Michael Dance <cubicwebs@gmail.com>
To: support@licensecart.com
Content-Type: multipart/alternative; boundary=001a11c3fe901a7ff904e6c10923

--001a11c3fe901a7ff904e6c10923
Content-Type: text/plain; charset=ISO-8859-1

Please work 

--001a11c3fe901a7ff904e6c10923
Content-Type: text/html; charset=ISO-8859-1

<div dir="ltr">Please work </div>

--001a11c3fe901a7ff904e6c10923--

 

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/pipe2.php
    generated by sales@licensecart.com
    local delivery failed

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

Return-path: <cubicwebs@gmail.com>
Received: from mail-la0-f53.google.com ([209.85.215.53]:58464)
        by cubic2.cubicwebs.com with esmtps (TLSv1:RC4-SHA:128)
        (Exim 4.80.1)
        (envelope-from <cubicwebs@gmail.com>)
        id 1VMjLb-0005tl-Rg
        for sales@licensecart.com; Thu, 19 Sep 2013 19:53:04 +0100
Received: by mail-la0-f53.google.com with SMTP id el20so7194026lab.40
        for <sales@licensecart.com>; Thu, 19 Sep 2013 11:53:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type;
        bh=Uixx2qsSnmTaUftBHcTCniq8cO5JJVqjH7GtVrGea9Q=;
        b=iyT1BFtJsdTug9QtNi39e4gPx0k7vPwv7Ff7iZnlvxbDOBBGWJi7eF1xE8GfozL5Iu
         MJrhXYd5aJm/Zg/J/RzTASyJgM+TGtwKvC5SUwToRdYao7/gGx+7DG7EwlIfjebShdvp
         XQdXNi/fAz8Jtb/uTzZyg98K2fatCFCAbI5Dd08ehO1U28qK0jEH0kW3ItU6KoWjo5km
         7FTXZUDJcxDlGKo+LEaCejJLpGi9OwfDmkasPUFn74+onk5a+rQqMZVoWW13pLeK4i0h
         d1jXcsoY2egZcOjaWxXBnbVEVKISEN9mpp9HeTNXhW6FxLsMkmzp/1VOcwzyfJrhu+cd
         1cEg==
MIME-Version: 1.0
X-Received: by 10.112.167.66 with SMTP id zm2mr2300373lbb.46.1379616782849;
 Thu, 19 Sep 2013 11:53:02 -0700 (PDT)
Received: by 10.112.181.196 with HTTP; Thu, 19 Sep 2013 11:53:02 -0700 (PDT)
Date: Thu, 19 Sep 2013 19:53:02 +0100
Message-ID: <CAFg25KFD2HHpK3VkjmRQSbBqx1u_wx8HiB57iWi8Sc_r94vCoA@mail.gmail.com>
Subject: Feeling Lucky
From: Michael Dance <cubicwebs@gmail.com>
To: sales@licensecart.com
Content-Type: multipart/alternative; boundary=001a11c38ba2449da904e6c11020

--001a11c38ba2449da904e6c11020
Content-Type: text/plain; charset=ISO-8859-1

Please  WORK BLESTA

--001a11c38ba2449da904e6c11020
Content-Type: text/html; charset=ISO-8859-1

<div dir="ltr">Please  WORK BLESTA</div>

--001a11c38ba2449da904e6c11020--
Link to comment
Share on other sites

  • 0

Can't get it working :l

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/pipe2.php plugin/support_manager/ticket_pipe/index/2
    generated by support@licensecart.com
    local delivery failed

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

Return-path: <cubicwebs@gmail.com>
Received: from mail-lb0-f182.google.com ([209.85.217.182]:44716)
        by cubic2.cubicwebs.com with esmtps (TLSv1:RC4-SHA:128)
        (Exim 4.80.1)
        (envelope-from <cubicwebs@gmail.com>)
        id 1VMjJg-0005pT-4u
        for support@licensecart.com; Thu, 19 Sep 2013 19:51:04 +0100
Received: by mail-lb0-f182.google.com with SMTP id c11so8235363lbj.13
        for <support@licensecart.com>; Thu, 19 Sep 2013 11:51:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type;
        bh=LIJadzvNxr3fp/JxVfq7L/+8nHXtW5vUWQBxgRyKF3c=;
        b=xJqh425ugflI208KWhlT/xVM3YpdMGI+sJfh1TogZLMkOKs5PwBxCquhWQ/5ZbHiUv
         1Bi3xCKBk0n83jgqqJYAcvzohjGhSaImFhC8UG+UsB9uizfFFtxIa3GUuyIoq/Cj1Mqj
         FkAMRhH7DRSyX16o2g+6uW9/sWGsBvGXt0f0cQE+0QAOdYeQNvqKos3p3vnJu6qnQrcL
         TENIBacSHCrLBp4SekZt7j0drgm6cTT+jdd5Fu+H+q79w5TxL+wXuhz891lPR8yDsv/Y
         txfXK0sQ+rNsuQ45nCGEnqzORlted8KF2ZT6zSKqvhbgmGmqZwMzLKQNJKcdknDL+2n+
         /KXw==
MIME-Version: 1.0
X-Received: by 10.112.52.225 with SMTP id w1mr2788627lbo.31.1379616662648;
 Thu, 19 Sep 2013 11:51:02 -0700 (PDT)
Received: by 10.112.181.196 with HTTP; Thu, 19 Sep 2013 11:51:02 -0700 (PDT)
Date: Thu, 19 Sep 2013 19:51:02 +0100
Message-ID: <CAFg25KGhtTPfqo25H7r60vo7tCc-=AorceWarzq_3F6XEukfvg@mail.gmail.com>
Subject: TESTInG
From: Michael Dance <cubicwebs@gmail.com>
To: support@licensecart.com
Content-Type: multipart/alternative; boundary=001a11c3fe901a7ff904e6c10923

--001a11c3fe901a7ff904e6c10923
Content-Type: text/plain; charset=ISO-8859-1

Please work 

--001a11c3fe901a7ff904e6c10923
Content-Type: text/html; charset=ISO-8859-1

<div dir="ltr">Please work </div>

--001a11c3fe901a7ff904e6c10923--
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/pipe2.php
    generated by sales@licensecart.com
    local delivery failed

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

Return-path: <cubicwebs@gmail.com>
Received: from mail-la0-f53.google.com ([209.85.215.53]:58464)
        by cubic2.cubicwebs.com with esmtps (TLSv1:RC4-SHA:128)
        (Exim 4.80.1)
        (envelope-from <cubicwebs@gmail.com>)
        id 1VMjLb-0005tl-Rg
        for sales@licensecart.com; Thu, 19 Sep 2013 19:53:04 +0100
Received: by mail-la0-f53.google.com with SMTP id el20so7194026lab.40
        for <sales@licensecart.com>; Thu, 19 Sep 2013 11:53:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type;
        bh=Uixx2qsSnmTaUftBHcTCniq8cO5JJVqjH7GtVrGea9Q=;
        b=iyT1BFtJsdTug9QtNi39e4gPx0k7vPwv7Ff7iZnlvxbDOBBGWJi7eF1xE8GfozL5Iu
         MJrhXYd5aJm/Zg/J/RzTASyJgM+TGtwKvC5SUwToRdYao7/gGx+7DG7EwlIfjebShdvp
         XQdXNi/fAz8Jtb/uTzZyg98K2fatCFCAbI5Dd08ehO1U28qK0jEH0kW3ItU6KoWjo5km
         7FTXZUDJcxDlGKo+LEaCejJLpGi9OwfDmkasPUFn74+onk5a+rQqMZVoWW13pLeK4i0h
         d1jXcsoY2egZcOjaWxXBnbVEVKISEN9mpp9HeTNXhW6FxLsMkmzp/1VOcwzyfJrhu+cd
         1cEg==
MIME-Version: 1.0
X-Received: by 10.112.167.66 with SMTP id zm2mr2300373lbb.46.1379616782849;
 Thu, 19 Sep 2013 11:53:02 -0700 (PDT)
Received: by 10.112.181.196 with HTTP; Thu, 19 Sep 2013 11:53:02 -0700 (PDT)
Date: Thu, 19 Sep 2013 19:53:02 +0100
Message-ID: <CAFg25KFD2HHpK3VkjmRQSbBqx1u_wx8HiB57iWi8Sc_r94vCoA@mail.gmail.com>
Subject: Feeling Lucky
From: Michael Dance <cubicwebs@gmail.com>
To: sales@licensecart.com
Content-Type: multipart/alternative; boundary=001a11c38ba2449da904e6c11020

--001a11c38ba2449da904e6c11020
Content-Type: text/plain; charset=ISO-8859-1

Please  WORK BLESTA

--001a11c38ba2449da904e6c11020
Content-Type: text/html; charset=ISO-8859-1

<div dir="ltr">Please  WORK BLESTA</div>

--001a11c38ba2449da904e6c11020--

Definitely not what I was hoping to hear. I was hoping you would be like do this and it fixes it.

Link to comment
Share on other sites

  • 0

I've made a little progress on getting this to work on cPanel... Using the code below (as stated by Cody) and saving the file as pipe_ah.php and setting the permission to 755... 

#!/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'
	);
	// 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();
	}
}
?>

 

I don't get any errors in the exim_mainlog, but the email is not converted to a ticket (it looks like it vanishes)... also the "allow only clients to open or reply to tickets" is not check... 

2013-09-19 15:39:11 1VMk49-0007p4-6k => |/home/domain/public_html/plugins/support_manager/pipe_ah.php (help@domian.com) <help@domain.com> R=virtual_aliases_nostar T=virtual_address_pipe
2013-09-19 15:39:11 1VMk49-0007p4-6k Completed

Getting warmer!!! 

Link to comment
Share on other sites

  • 0

Still testing it out, but try the attached file. Upload to /plugins/support_manager/. Your pipe should be similar to:

 

/usr/bin/php /path/to/blesta/plugins/support_manager/pipe.php

 

Note, this file has no hashbang by default. cPanel installs should create the proper hashbang when the pipe is created. Other systems may do the same, but it is always preferable to invoke the pipe using the path to PHP (as in the example above.)

pipe.php

Link to comment
Share on other sites

  • 0

Still testing it out, but try the attached file. Upload to /plugins/support_manager/. Your pipe should be similar to:

 

 

/usr/bin/php /path/to/blesta/plugins/support_manager/pipe.php

 

Note, this file has no hashbang by default. cPanel installs should create the proper hashbang when the pipe is created. Other systems may do the same, but it is always preferable to invoke the pipe using the path to PHP (as in the example above.)

 

Thanks mate but I get this:

 

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/plugins/support_manager/pipe.php
    generated by sales@licensecart.com
    local delivery failed

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

Return-path: <cubicwebs@gmail.com>
Received: from mail-la0-f49.google.com ([209.85.215.49]:62501)
        by cubic2.cubicwebs.com with esmtps (TLSv1:RC4-SHA:128)
        (Exim 4.80.1)
        (envelope-from <cubicwebs@gmail.com>)
        id 1VMlO4-0000qP-Mx
        for sales@licensecart.com; Thu, 19 Sep 2013 22:03:44 +0100
Received: by mail-la0-f49.google.com with SMTP id ev20so7197450lab.8
        for <sales@licensecart.com>; Thu, 19 Sep 2013 14:03:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type;
        bh=k1IIpbafTjoi3JdhTp3ztyt2Rm2mSwYYZeZSOVcgr18=;
        b=Uqi/R4Tg2F7hJnAD2lKc7SAPn0/QbmX+9FEuzHUjD5NGhySqhd1vI1qvzgItiSg+S0
         1lSVbwxRgRWOGNHNM6rBSZrqhr4ctffngxkyVK60BwTe70kFvQP7Tq9rC965tDc8nwGH
         HwvD8syz83/7nqy8mBUoiLaYNxSwMnJpO3hW71sjyu32/NkrTrhaNivRXWKHhhI7eDBQ
         B+FZwF4au5nd6i8ncLgfQmK1DTEykAJ/Rkbld72tdKx64ICe8EtPjwG3Npv+upsQsWAA
         LNFHpLqBIeleMvxQnF/ufBqLKjjdiN9z360cKEta9rNNsnJPTKny5l10l1BOY5JJhmrw
         +8nA==
MIME-Version: 1.0
X-Received: by 10.152.19.97 with SMTP id d1mr2879407lae.34.1379624623762; Thu,
 19 Sep 2013 14:03:43 -0700 (PDT)
Received: by 10.112.181.196 with HTTP; Thu, 19 Sep 2013 14:03:43 -0700 (PDT)
Date: Thu, 19 Sep 2013 22:03:43 +0100
Message-ID: <CAFg25KHg83sukgAx2+wu0PFb3m6biaHmu1jMw-zwf+JpORnZXQ@mail.gmail.com>
Subject: Testing once more
From: Michael Dance <cubicwebs@gmail.com>
To: sales@licensecart.com
Content-Type: multipart/alternative; boundary=089e0149373c9f75a004e6c2e381

--089e0149373c9f75a004e6c2e381
Content-Type: text/plain; charset=ISO-8859-1

Testing Blesta.

--089e0149373c9f75a004e6c2e381
Content-Type: text/html; charset=ISO-8859-1

<div dir="ltr">Testing Blesta.</div>

--089e0149373c9f75a004e6c2e381--

Tried it another way and got this:

 

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/plugins/support_manager/pipe.php plugin/support_manager/ticket_pipe/index/2
    generated by support@licensecart.com
    local delivery failed

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

Return-path: <cubicwebs@gmail.com>
Received: from mail-lb0-f173.google.com ([209.85.217.173]:62432)
        by cubic2.cubicwebs.com with esmtps (TLSv1:RC4-SHA:128)
        (Exim 4.80.1)
        (envelope-from <cubicwebs@gmail.com>)
        id 1VMlRR-0000wm-Om
        for support@licensecart.com; Thu, 19 Sep 2013 22:07:13 +0100
Received: by mail-lb0-f173.google.com with SMTP id o14so8273613lbi.18
        for <support@licensecart.com>; Thu, 19 Sep 2013 14:07:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type;
        bh=BcF0an5o2JQaJgU6zlLHW7g8EqLNaZbPpLY0dNwXp6o=;
        b=FK7Rej9tgWx/zdFK1TKPnWoccJanBOus0Jb7SaHawCZUNug1I/kV9EcPl80FvvQITx
         SKkTAetXnejBdpExOVn4GEu5mZC+LtzFswMZ7eXgydPTa2cDkb+yvwjLIb3XZKV3x3uQ
         hcYJRQRi65mkKG8CjpQ9OdHhQZsILqDEesbGPUpfW4hrHUA5fLvUqjgEQN6396iQd3sE
         NpcDtKMHc39JwMJz0g0mbyQdN5TbDEF8+M7mg30H6aFKco8QYsg/XkK7V/JdpgvEIw+8
         5htxWxaH7X0iadgU6QFiyBE95mdDFUB5QmJiLrsqczqnaAB32E+tzZk9ZtenMB0zg/jQ
         RZSg==
MIME-Version: 1.0
X-Received: by 10.112.138.170 with SMTP id qr10mr2775956lbb.36.1379624832687;
 Thu, 19 Sep 2013 14:07:12 -0700 (PDT)
Received: by 10.112.181.196 with HTTP; Thu, 19 Sep 2013 14:07:12 -0700 (PDT)
Date: Thu, 19 Sep 2013 22:07:12 +0100
Message-ID: <CAFg25KG7+ycLp0D5EGbioGPYBa67gAEa73FbHg4zy=GBP0oZxg@mail.gmail.com>
Subject: Testing forever
From: Michael Dance <cubicwebs@gmail.com>
To: support@licensecart.com
Content-Type: multipart/alternative; boundary=089e0116103013641f04e6c2f07c

--089e0116103013641f04e6c2f07c
Content-Type: text/plain; charset=ISO-8859-1

 pleaseeeeeeeee work.

--089e0116103013641f04e6c2f07c
Content-Type: text/html; charset=ISO-8859-1

<div dir="ltr"> pleaseeeeeeeee work.</div>

--089e0116103013641f04e6c2f07c--
Link to comment
Share on other sites

  • 0

The issue is you don't have a path to PHP in your pipe and your pipe.php doesn't have a hashbang identifying the path. You nee to either:

 

1. Configure your pipe to contain the path to PHP as in the example I listed in my previous post

2. If you do #1 above, in cPanel, cPanel will ask you if you want to modify pipe.php to include the hashbang. cPanel REQUIRES the hashbang be present in pipe.php because they do not support using the path to PHP.

Link to comment
Share on other sites

  • 0

The issue is you don't have a path to PHP in your pipe and your pipe.php doesn't have a hashbang identifying the path. You nee to either:

 

1. Configure your pipe to contain the path to PHP as in the example I listed in my previous post

2. If you do #1 above, in cPanel, cPanel will ask you if you want to modify pipe.php to include the hashbang. cPanel REQUIRES the hashbang be present in pipe.php because they do not support using the path to PHP.

 

I have:

 

#!/usr/bin/php -q
<?php
/**
 * This files pipes email messages into the system. This is configured to process
 * messages for only a single company ID. Clone this file and change the
 * $company_id variable below to add pipe support for additional companies.
 */
$company_id = 2;

try {
	include(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib/init.php");
	
	$_SERVER['REQUEST_URI'] = null;
    $argv = array(
        '',
		'plugin/support_manager/ticket_pipe/index/' . $company_id
    );
	unset($company_id);
	
	// 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();
	}
}
?>

And cPanel made it executable.

Link to comment
Share on other sites

  • 0

Hm... not sure what the problem could be then. The pipe.php file works for me using cPanel. Of course our cPanel account added the hashbang a little differently as #!/usr/local/bin/php -q, but I'm sure that's an OS difference.

 

Oh I love you (Joking) haha but yeah thank you, cPanel breaks stuff it's way your top code fixed it for me :)

 

 

Both companies work now, oh it's so good to have the piping back :D

Link to comment
Share on other sites

  • 0

I have it fixed again. This did it for me:

 

pipe1.php if you're using multiple companies copy this into multipe files, pipe2.php, pipe3.php etc and then update $company_id = 1; to whatever company number the pipe corresponds to then forward to the file.

#!/usr/local/bin/php -q
<?php
/**
 * This files pipes email messages into the system. This is configured to process
 * messages for only a single company ID. Clone this file and change the
 * $company_id variable below to add pipe support for additional companies.
 */
$company_id = 1;

try {
	include(dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib/init.php");
	
	$_SERVER['REQUEST_URI'] = null;
    $argv = array(
        '',
		'plugin/support_manager/ticket_pipe/index/' . $company_id
    );
	unset($company_id);
	
	// 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();
	}
}
?>

 

Link to comment
Share on other sites

  • 0

Hm... not sure what the problem could be then. The pipe.php file works for me using cPanel. Of course our cPanel account added the hashbang a little differently as #!/usr/local/bin/php -q, but I'm sure that's an OS difference.

 

Holy cow! Changing the hashbang did it:

 

We have received your request and someone will be looking at it shortly.

Link to comment
Share on other sites

  • 0

And now, again I have issues with this.. I know everything was working before upgrading to 3.0.4 but since I'm not really sure.

 

I get return emails with the following:

 

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/members/plugins/support_manager/pipe1.php
    generated by support@memoryx2.com
    local delivery failed

The following text was generated during the delivery attempt:

------ pipe to |/home/username/public_html/members/plugins/support_manager/pipe1.php
       generated by support@memoryx2.com ------


Fatal error: Call to undefined function mailparse_msg_create() in /home/username/public_html/members/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/members/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/members/plugins/support_manager/vendors/mime_mail_parser/MimeMailParser.class.php</strong></p>
                </div>
        </div>  </body>
</html>
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

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

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

Return-path: <emailaddress>
Received: from mail-ie0-f174.google.com ([209.85.223.174]:39235)
        by enterprise.hq.memoryx2.com with esmtps (TLSv1:RC4-SHA:128)
        (Exim 4.80.1)
        (envelope-from <my email )
        id 1VYqnr-0000Tu-3u
        for support@memoryx2.com; Wed, 23 Oct 2013 00:16:19 -0500
Received: by mail-ie0-f174.google.com with SMTP id qd12so491501ieb.33
        for <support@memoryx2.com>; Tue, 22 Oct 2013 22:16:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:sender:date:message-id:subject:from:to:content-type;
        bh=XIa9rqrkfxewFuIeAJ0xHK+b8sod2nalnIX2oeX8gm0=;
        b=aYHLdOtBA+K4Iox/Feb1n0tSpjBW02136BD5ECWqmuKWMfc3YWCCR9LBp3CnyQHftN
         yNY8wadjtFIocCCmUsYkE86u/82ZuWfUfqpY7wtYKCHEv7Jw9OQZO/RCgUn15Xf57ohE
         HXff+LUKWK7jo7MJyXPeClGXBsceDUhuzjIOdD4+CS9d+oHgKQ55Pv8JvmIDmdWdnQJW
         ovWUo40kt5Iz0INBCdNhy6/Tz5kk+C+9PZ3YT+DDqOExT+nDIhyIqfiEoUXeewGsvRGw
         +rtiDkq8/jw0rSj9mRoQHnfA8PbLsUZKCqgSktkIQuDMzTsg1Lam/mKRUXLWJkhQv2cH
         h17Q==
MIME-Version: 1.0
X-Received: by 10.50.114.67 with SMTP id je3mr192606igb.59.1382505378378; Tue,
 22 Oct 2013 22:16:18 -0700 (PDT)
Sender: kylestheman1212@gmail.com
Received: by 10.64.33.72 with HTTP; Tue, 22 Oct 2013 22:16:18 -0700 (PDT)
Date: Wed, 23 Oct 2013 00:16:18 -0500
X-Google-Sender-Auth: 80N9gXu8VITG94BQycNfQXSIkSg
Message-ID: <CAKupvYWwuAHOiArvPnwZmjWeAU7F2X7NEh=RpQ_5TWgSvcBxbQ@mail.gmail.com>
Subject: test
From: Kyle Wigginton <kyle@mx2.co>
To: support@memoryx2.com
Content-Type: multipart/alternative; boundary=047d7b3a9b40fa7ef704e9619df6

--047d7b3a9b40fa7ef704e9619df6
Content-Type: text/plain; charset=UTF-8

test

--047d7b3a9b40fa7ef704e9619df6
Content-Type: text/html; charset=UTF-8

<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;color:#000000">test</div></div>

--047d7b3a9b40fa7ef704e9619df6--
Link to comment
Share on other sites

  • 0

And now, again I have issues with this.. I know everything was working before upgrading to 3.0.4 but since I'm not really sure.

 

I get return emails with the following:

 

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/members/plugins/support_manager/pipe1.php
    generated by support@memoryx2.com
    local delivery failed

The following text was generated during the delivery attempt:

------ pipe to |/home/username/public_html/members/plugins/support_manager/pipe1.php
       generated by support@memoryx2.com ------


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

 

Looks like you either moved servers or disabled the Mailparse extension. That extension is required for parsing incoming emails for the ticket system.

Link to comment
Share on other sites

  • 0

Hello,

 

Folowing this topic I have found a misconfiguration on pipe.php that, have to be by default in and not the outher way around because more thant 90% of people use cPanel/Linux and almot everyone wen configuring this to pipe will have problems.

 

By default the file /plugins/support_manager/pipe.php  have to be CHMOD 777 and have to include the hashbang in the beginig of the file #!/usr/local/bin/php -q  (I know that is documented in here http://docs.blesta.com/display/user/Support+Manager#SupportManager-EmailPiping)

 

Anouhter thing, you could only show on admin suport manager departments, the pipe /usr/bin/php /home/user/public_html/plugins/support_manager/pipe.php and not the complete /usr/bin/php /home/user/public_html/index.php plugin/support_manager/ticket_pipe/index/1 because for almost everyone will get errors importing with pipe, and on the documentation had the two options :)

 

Note: I have tested, that if you are using IMAP/POP option, you cannot change the file /plugins/support_manager/pipe.php  to CHMOD 777 and cannot had the hashbang or it sends you an error. This is a bug that have to be fixed.

 

Maybe add 2 files one for pipe and anouther for imap/pop with diferent settings.

 

Alot to seek on piping and mailparse. sorry. Have to check more code on Blesta.

 

Regards,

Paulo V

Edited by Paulo V
Link to comment
Share on other sites

  • 0

I had this issue.

 

The fix: I didn't enable piping in the department itself. I'm not sure if its buggy behavior or not that piping isn't always enabled anyways no matter what I select (as in, remove none, replace with piping which is just "no imap or pop3 on top of piping").

 

your-blesta/admin/plugin/support_manager/admin_departments/edit/1/

Link to comment
Share on other sites

  • 0

This was fixed on the latest 3.1.3, we dont have any errors on Piping (Have to CHMOD 777 the /plugins/support_manager/pipe.php), and also the Mailparsins thar now all characters are correctly decoded :)

 

 

I had this issue.

 

The fix: I didn't enable piping in the department itself. I'm not sure if its buggy behavior or not that piping isn't always enabled anyways no matter what I select (as in, remove none, replace with piping which is just "no imap or pop3 on top of piping").

 

your-blesta/admin/plugin/support_manager/admin_departments/edit/1/

 

 

Are you using the latest Blesta 3.1.3 ?

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