Page 1 of 3

2 issues with piping

Posted: Sat Jan 14, 2017 5:07 am
by ashenfire
Script URL: /home/*myusername*/home/contactus/hesk/inc/mail/hesk_pipe.php
or start hesk page: http://projectashenfire.org/home/contac ... /workshop/
Version of script: 2.7.2
Hosting company: webhosting.com
URL of phpinfo.php: Shared hosting, not sure I have access.
URL of session_test.php: *Did not have one originally. Set one up in http://projectashenfire.org/home/contac ... n_test.php

What terms did you try when SEARCHING for a solution:

piping
piping -flood
cagefs


I can't get answers from my own hosting site. I ask them for the PHP location and they inform me I cant change very many configurations.
I had to change my tone in my email until they gave me the answer I needed. So I am asking on this site because I don't
wan't to deal with them any more.

I used to have piping in 2.6.8, but since the update alot of items broke, including piping.

I was using hesk_pop3.php at the time.

With 2.7.2 I can not get hesk_pipe.php option to work. It is my preferred method and I am trying very hard to get it to work.
I don't want to use hesk_pop3.php method if I can help it.


I have two questions.

Question 1.

Why was my hesk_pop3.php updating to my tickets without doing a cron job?
When I upgraded, I lost that ability and I don't seem to have permissions to do a cron job to update piped tickets.

Question 2.

I finally verified the location of PHP: /usr/local/bin/php
I used the piping FAQ on this site.

Forwarded my email to redacted@example.com

Forwarding address used: /home/myusername/home/contactus/hesk/inc/mail/hesk_pipe.php

If I use the shortened version /home/contactus.......it will auto correct me and apply /home/myusername/home/contactus~
So, I am certain I entered it correctly.

I have Chmod 755 permissions on the inc/mail folder and the file hesk_pipe.php.

Inside hesk_pipe.php, the first line is #!/usr/local/bin/php -q

*I omitted references in this message about my username reference for security reason* and replaced it with 'myusername'

Testing the email from another email account, I get an error:

_____________________________________________________________
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/myusername/home/contactus/hesk/inc/mail/hesk_pipe.php
generated by redacted@example.com
local delivery failed

The following text was generated during the delivery attempt:

------ pipe to |/home/myusername/home/contactus/hesk/inc/mail/hesk_pipe.php
generated by redacted@example.com ------

cagefs_enter: /home/myusername/home/contactus/hesk/inc/mail/hesk_pipe.php: No such file or directory
Reporting-MTA: dns; server408.webhostingpad.com

Action: failed
Final-Recipient: rfc822;|/home/myusername/home/contactus/hesk/inc/mail/hesk_pipe.php
Status: 5.0.0
____________________________________________________________________________


1. So, is the 'No such file or directory' reference on the CAGEFS line, referring to a wrapper looking for an incorrect
location to do its function, or is that line saying it can not find the folder: /usr/local/bin/php?

Re: 2 issues with piping

Posted: Sat Jan 14, 2017 8:37 am
by Klemen
Question 1:

I don't understand what do you mean here? Was POP3 fetching puling your emails into tickets? This can only happen if:

1. POP3 fetching is enabled, AND
2. hesk_pop3.php is run via Cron or in the browser


Question 2:

cagefs is filesystem from Cloudlinux, it has nothing to do with Hesk. I don't use Cloudlinux so not sure if it's the PHP file or PHP executable it cannot find.

Looking at the path, are you 101% sure it is correct? There is usually another directory called "public_html" between "myusername" and your "home" directory.

The phpinfo file should tell more: http://www.phpjunkyard.com/extras/phpinfo.zip

Re: 2 issues with piping

Posted: Sat Jan 14, 2017 11:33 pm
by ashenfire
Thank you.
I copy and paste everything. So, this teaches me not to try to double check my work on my 20th hour of the day.

The email forwarding program adds '/home/myusername/' to whatever I enter into the forwarding field.
I entered: /home/myusername/public_html/home/contactus/hesk/inc/mail
It morphed it into: /home/myusername/home/myusername/public_html/home/contactus/hesk/inc/mail

My attempts to backspace and repair that field caused my first problem of getting the path wrong.

Anyways, I corrected the forwarding address and I am 101% sure that I got it right.
Cross check my trusty FTP and double checking the forwarding program:
/home/myusername/public_html/home/contactus/hesk/inc/mail

Anyways. No success. Now the error is a permissions problem.

First part of error is same as above with different path.

_____________________________Second part of error_________________
The following text was generated during the delivery attempt:

------ pipe to |/home/myusername/public_html/home/contactus/hesk/inc/mail
generated by redactedwebsite.org ------

cagefs_enter: /home/myusername/public_html/home/contactus/hesk/inc/mail: Permission denied
____________________________________________________________________


This indicates it is out of your hands.

I am on a shared hosting plan.
Now I will have to find out if it is normal for restrictions on the shared plan or find a work around.

I checked permissions for each part of the path: "/usr/local/bin/".
they all are chmod 755 and PHP is 777 "Irwxrwxrwx.





As far as Question 1.
I attempted in 2.6.8 to do piping for hesk_pipe.php and hesk_pop3.php and left the forwarding address
(can not remember which one was last because I didn't document my steps).
The point is, I could get my tickets to update on their own without doing a cron job. So I guess that was
a fluke.

Any hints would be accepted, but I suppose this ticket can be closed.
Thanks for helping me narrowing it down.

Re: 2 issues with piping

Posted: Sun Jan 15, 2017 10:12 am
by Klemen
Now you are missing "hesk_pipe.php" at the end of the path.

The correct one should be:

Code: Select all

/home/myusername/public_html/home/contactus/hesk/inc/mail/hesk_pipe.php
I wouldn't mess with any permissions in the /usr/local/bin/ folder, those should be just fine in PHP works on your server.

The only permission you need to worry about is hesk_pipe.php (and hesk_pop3.php) which should be 755. Don't modify any other file/folder permissions from the previous (working) ones.

Re: 2 issues with piping

Posted: Mon Jan 16, 2017 4:02 am
by ashenfire
Well I know better, air head move. Sorry for the inconvenience.
I quadrupled checked and verified it is now correct for the path.

Since I am having such a bad day, I even copied hesk_pipe.php to my desktop and realized it got reverted to the wrong directory.
So after screaming and tearing off the rooftops in my neighborhood......

I put the correct folder location for PHP back in the hesk_pipe.php

The first line of hesk_pipe.php is again: #!/usr/local/bin/php -q

I even extracted a fresh copy of hesk_pipe.php from the 2.7.1 folder, edited the first line to be: #!/usr/local/bin/php -q
and replaced the site version via ftp.


Permission denied.

------ pipe to |/home/user/public_html/home/contactus/hesk/inc/mail/hesk_pipe.php
generated byme.
cagefs_enter: /home/user/public_html/home/contactus/hesk/inc/mail/hesk_pipe.php: Permission denied

Re: 2 issues with piping

Posted: Mon Jan 16, 2017 8:59 am
by Klemen
Do you have SSH access to the server?

If yes, one more thing you could try is running this command:

Code: Select all

dos2unix /home/myusername/home/contactus/hesk/inc/mail/hesk_pipe.php
Then try again.


P.s.: if you don't have dos2unix you should be able to get it from your package manager.

Debian-based distro: sudo apt-get dos2unix
RH-like distro: sudo yum install dos2unix

Re: 2 issues with piping

Posted: Fri Jan 20, 2017 5:04 am
by ashenfire
Thanks for your troubleshooting/help.
I finally got the admin on my hosting site to finally check into permissions and cagefs issues.

They must have done something because piping works now. Well mostly.
A test message will create a ticket, then go to my pop3 account. The way I expected.

However....
The sender gets an error stating the message was never delivered :!:
This of course makes me look less dependable and causes uneccessary work and uncertainty for the client.

They re-did their CageFS software but it didn't eradicate the message.

Anyways...thanks.

Piping followup: methodology and CPANEL

Posted: Sat Jan 21, 2017 10:14 pm
by ashenfire
In my last post, I was trying to get piping to work with hesk_pipe.php.
Finally it partially worked where I was getting the test messages into my tickets and my pop3 email.
It still was not good since I was getting a failed delivery message. Can't let customers see that message.

:? I started a ticket with my hosting provider to ask them to help me stop the 'mail delivery system failed' from reaching clients.

After a few days of frustration they finally called CPANEL and this is what my hosting provider gave me
=======================================================================
Hello Ashley,
We consulted the cpanel techs once again and this response we have got

As mentioned previously a forwarder should not be used to pipe. The pipe should be removed from the forwarder and then an email filter should be used instead to pipe to a program.
======================================================================================================================

I told them forwarding should be fine, since I was told by another expert thats how I get my HESK piping to work.
They replied that is not so.

Since I asked them for help in the first place, I removed the forwarding command and did what they told me to do. They told me to
add a FILTER. I still have a failed mail delivery error; even though I receive the test message in my pop3 account AND it is piped to
hesk_pipe.php.

CageFS error disappeared, but I am having the same issue.

:arrow: Is there anything in the Hesk setup that I could have setup up incorrectly that causes a mail daemon error to report a 'failed mail delivery' message?

:arrow: If FILTERING email somehow is 'better' I am wondering if that could be added to the FAQ so the user does not get a lot of 'push back'
from her hosting tech support when troubleshooting.


:arrow: Error is below if it is neccessary to know.



Thanks again for this program and your help,
Ashenfire







The following text was generated during the delivery attempt:

------ pipe to |/home/accountholder/public_html/home/contactus/hesk/inc/mail/hesk_pipe.php
generated by redacted user email ------


Reporting-MTA: dns; server408.webhostingpad.com

Action: failed
Final-Recipient: rfc822;|/home/accountuser/public_html/home/contactus/hesk/inc/mail/hesk_pipe.php
Status: 5.0.0

Re: 2 issues with piping

Posted: Sun Jan 22, 2017 9:33 am
by Klemen
Please don't start a new thread for the same issue; I merged it with the old one.

Before we go any further - have you tried dos2unix as suggested in my previous post? Really, try it.

Re: 2 issues with piping

Posted: Sun Jan 22, 2017 3:11 pm
by ashenfire
I believed it was okay for me to start a new thread because you helped me as much as you could on the first ticket.

I started a new thread because I was addressing a different part of piping and I was not trying to trouble shoot the original problem anymore.
You helped me alot and I figured it was out of your hands. I did not want to waste your time with it.

That being said, I apologize for the new thread. I hope it did not come off as trolling.

I have no direct access to a shared hosting site. I can not run packages. I also do not have access to the programs you mention, nor the knowledge
to run them. I am a reasonable 'quick study' and maybe I could have researched how to do it; and where to find the programs, but I would not
have access to the site to run them.

I do appreciate your suggestion. I love how you were taking charge :!:

So anyways, good news :!:

When I added the correct path to my PHP directory, that is on the first line, I pressed enter.
After fighting with 'help' on my hosting site, their senior admin/server specialist finally FTP'd my site
and opened my hesk_pipe.php file and told me there was a space between my first line and my third line that
caused this.

Anyways, true or not, I do not have the problem anymore. They actually edited the file and removed the second line.
I can verify that because I have a lab and I compared file size and date time stamp (same time they responded to my ticket).

The only question remaining, is why would they tell me I should not FORWARD email, that I must FILTER email to pipe.
I need to know, so the 'help' on my hosting site does not go astray and tell me I am doing something wrong, when I have
experts on this site that are doing it just fine.

Re: 2 issues with piping

Posted: Sun Jan 22, 2017 6:59 pm
by Klemen
That's what I though hence the dos2unix mention. The mail delivery agent considers any output returned by a script as an error so while the script worked, the extra line (or a \r char) can cause php to output http headers hence the error you were receiving (with no actual error message as none was output).

I'm not sure what difference between a Cpanel forward or filter is under the hood, but both support email piping and I have been using forwards for years without issues. If it wasn't supported Cpanel would have removed piping to a program from email forwards yet it's still there in the latest version.

Anyway, I'm glad you got it working.

Re: 2 issues with piping

Posted: Sun Jan 22, 2017 9:05 pm
by ashenfire
Thank you very much for that explanation.

When they troubleshot, something else broke, now (when using filtering to pipe), I receive the test message in HESK, but
my POP3 account does not receive the message.

Also, on a related issue: I have settings/email/Email Sending set to: PHP mail() however when I write tickets in HESK,
the client never receives my message.

I went back to the filter and added a second filter to send the message to the same address it was piping to and it didn't flood.
So, anyone who is forced into working with hosting that insists you filter instead of email forwarding, this is your solution.

Re: 2 issues with piping

Posted: Fri Dec 11, 2020 3:24 am
by crazynet
I am having a similar issue:

When I email the support email address a ticket is created and a ticket submitted email returns right away.
[#GP3-362-AAB4] Ticket received

I also am get a second email like this:
From Mail Delivery System
Mail delivery failed: returning message to sender
To: {my email address}

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/local_install/inc/mail/hesk_pipe.php
generated by support@support.com





Reporting-MTA: dns; mi3-ls11.a2hosting.com

Does anyone know what the problem might be?

Thanks a ton!

Re: 2 issues with piping

Posted: Sat Dec 12, 2020 12:40 pm
by Klemen
If you are on a Linux server could be due to non-unix type line endings.

If you have been editing the hesk_pipe.php file, try uploading the original file again (don't open it, don't change anything, not even the first line).

Or use a program like Notepad++ to convert line endings from Windows or Mac to Unix.

Re: 2 issues with piping

Posted: Tue Dec 15, 2020 6:03 am
by crazynet
Thank you, I opened the hesk_pipe.php in Notepad++ then went to edit EOL Conversion and selection UNIX. Uploaded the file to replace existing file. Then updated to permissions back to 755. I still get an mail error see below.

What do you suggest?

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/local_install/inc/mail/hesk_pipe.php
generated by support@support.com

The following text was generated during the delivery attempt:



Reporting-MTA: dns; mi3-ls11.a2hosting.com

Action: failed
Final-Recipient: rfc822;
Status: 5.0.0

From:
Subject: Test 41
Date: December 13, 2020 at 6:50:33 PM MST
To: support@support.com