Page 2 of 3
Re: 2 issues with piping
Posted: Tue Dec 15, 2020 7:48 am
by Klemen
This usually happens when the script returns something (anything), even a blank line or hidden UTF-8 BOM.
Have you tried the original unmodified file, as suggested?
Re: 2 issues with piping
Posted: Thu Dec 17, 2020 4:26 am
by crazynet
THAT WORKED! Thank you Sensei.
Here are the steps I took in case someone else is in the same situation of sending an email to the support email and getting a ticket created and getting both a confirmation email and message failed email.
1- re-downloaded the Hesk zip from
https://www.hesk.com/download.php.
2- Opened cPanel >>File Manager then to the Hesk install inc folder >>mail >>hesk_pipe.php.
3- Clicked on it to select, then clicked upload file.
4- Navigated to the hesk_pipe.php file I just down loaded and uploaded and chose to overwrite the file.
5- in file manager clicked edit hesk_pipe.php and carefully deleted the path to PHP and entered my path without spacing or hitting the enter key and saved.
6- in file manager clicked hesk_pipe.php to highlight then clicked permissions and set to 755 and clicked save.
7- repeated step 6 to verify it saved.
8- sent an email to the support email and it worked.
Good luck and thank you!
Re: 2 issues with piping
Posted: Sat Dec 21, 2024 11:45 am
by ztank
Hello guys,
I am experiencing exactly the issue well described in one of the post of this thread by @crezynet
crazynet wrote: Fri Dec 11, 2020 3:24 am
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!
I literally tried everything already suggested:
- dos2unix hesk_pipe.php then upload
- edited the first line of the file without adding any Enter before saving
- downloaded the original hesk_pipe.php file form hesk 3.5.1 (the version I am currently using btw) and uploaded back and overwritten the current one
- downloaded the original hesk_pipe.php file, opened it in a linux editor (gnome-text-editor) and saved as UTF-8 linux/unix style before uploading again replacing the old one
Nothing seems to avoid the second email after the regular creation of the ticket.
What else should I try?
Thanks.
Re: 2 issues with piping
Posted: Sat Dec 21, 2024 5:56 pm
by ztank
It seems I have found a workaround...
I am not particularly proud of it but after many tests it appears to work just fine.
I replaced the first shebang line of hesk-pipe.php file with this one which includes a standard output redirect into /dev/null
#!/usr/bin/php -q > /dev/null
Thoughts?
Thanks.
Note: I initially used the "#!/usr/bin/php -q > /dev/null 2>&1" shebang which works as well but realized soon that also removing the standard error redirect also worked and decided to use the leaner approach
Re: 2 issues with piping
Posted: Sat Dec 21, 2024 6:20 pm
by Klemen
In direct email piping, the "email delivery failed" email is sent when the piped function returns any output (could be an empty line, hidden UTF-8 BOM, PHP startup errors/warnings...).
Since you've tried all that, I am not sure what the exact error was in your case, but if the modification works well for you, go with it

Re: 2 issues with piping
Posted: Sat Dec 21, 2024 6:31 pm
by ztank
I am happy to debug it if you show me how.
Thanks.
Re: 2 issues with piping
Posted: Mon Dec 23, 2024 11:03 am
by Klemen
If you turn "Debug mode" on in Hesk admin > Settings > Help desk (save changes) and use the original unmodified hesk_pipe.php file, what exactly does the return email say (full message)?
Re: 2 issues with piping
Posted: Mon Dec 23, 2024 11:45 am
by ztank
Hello,
see if this level of details is enough:
Mail Delivery System
Subject: Mail delivery failed: returning message to sender
From:
mailer-daemon@sv69.ifastnet.com
To:
XXXXXXX.XXXXXXX@yahoo.com
Sat, Dec 21 at 10:58 AM
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/smsfarma/XXXXXXX.XXXXXXX.eu.org/inc/mail/hesk_pipe.php
generated by
ticket@XXXXXXX.XXXXXXX.eu.org
The following text was generated during the delivery attempt:
------ pipe to |/home/smsfarma/XXXXXXX.XXXXXXX.eu.org/inc/mail/hesk_pipe.php
generated by
ticket@XXXXXXX.XXXXXXX.eu.org ------
test new
Regards.
Re: 2 issues with piping
Posted: Mon Dec 23, 2024 12:30 pm
by Klemen
Not sure where the "test new" comes from (hesk_pipe.php doesn't print out any text), but that is what's likely causing the returned email.
Re: 2 issues with piping
Posted: Mon Dec 23, 2024 1:47 pm
by ztank
Hello there,
"test new" was the subject as well as the body of the mail I sent to
ticket@XXXXXXX.XXXXXXX.eu.org address in order to have it piped.
As said the process works but there are 2 emails back to the sender address (now not any more as I have appended the "> /dev/null" to the shebang line):
1) The first email I get is the one acknowledging the ticket has been successfully created
2) The second email is the one attached to my previous post.
After turning on the debug mode where should I check? Same folder where the php (original) script is running from? Will it create a file eventually?
Thanks,
Re: 2 issues with piping
Posted: Mon Dec 23, 2024 1:51 pm
by Klemen
The debug mode would expose any errors/notices on the Hesk side. In your case what's triggering the returned mail is that the email contents are output via the pipe.
Why that is happening, I don't know (it's a server-side thing, not something Hesk outputs), but > /dev/null suppresses that, so I wouldn't worry about it.
Re: 2 issues with piping
Posted: Wed Jan 01, 2025 5:28 pm
by teodorpav
When replying to an email and the subject line contains RE:[#XXX-XXX-XXXX], the piping creates a new ticket instead of going to the existing one.
Last version 3.5.1.
How to fix this?
Thank you
Teodor
Re: 2 issues with piping
Posted: Wed Jan 01, 2025 5:51 pm
by Klemen
Please try searching the forum as this has been answered multiple times already.
Re: 2 issues with piping
Posted: Wed Jan 01, 2025 8:12 pm
by teodorpav
Happy New Year!
That was the first thing I did.
I always look for previous answers first.
Unfortunately, I didn't find anything, which is why I asked.
I would be grateful if you could at least tell me what keywords to search with.
I didn't find anything about this problem on replay new ticket.
viewtopic.php?t=4520&start=15
Re: 2 issues with piping
Posted: Thu Jan 02, 2025 1:59 pm
by Klemen
See this for example:
viewtopic.php?t=7540