Email pipe creating multiple tickets

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Josebaggins
Posts: 3
Joined: Wed Jan 25, 2012 12:58 am

Email pipe creating multiple tickets

Post by Josebaggins »

Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

Bit of a wierd one, I've got email piping up and running, problem is, it creates two identical tickets for each email sent (Different ID numbers, but same content)

I've verified that only one message is received at the server, and other than that it seems to behave absolutely as expected...

We're running Exim 4 (Maildir) on Debian, and the piping is acheived by a user .forward

I've tested this using a relay from an external exchange server as well as mailing directly into Exim, same result. One theory is that Exim is adding it's <envelope-to>/<return-path> headers to the message, so the parser is picking up the sender twice and creating two tickets?

Any ideas on what to try to troubleshoot this? I've been plugging away at this for a couple of days now, and I've run out of steam...

Thanks in advance.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Email pipe creating multiple tickets

Post by Klemen »

The parser creates only one ticket no matter what the headers say, so the real issue is the email is being piped twice to the parser.

You should be able to confirm this by replacing hesk_pipe.php with a simple script like this

Code: Select all

#!/usr/bin/php -q
<?php
mail('you@you.com','Pipe received','A message has been received via pipe');
return NULL;
?>
Change you@you.com to your own address and you should receive an email each time something gets piped to the script - two "Pipe received" emails in your case for each email piped.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Josebaggins
Posts: 3
Joined: Wed Jan 25, 2012 12:58 am

Re: Email pipe creating multiple tickets

Post by Josebaggins »

Yep you're right, I still got both emails when using that code in 'test.php'

I should have mentioned this before, it totally slipped my mind, sorry.

I made a small modification to the hesk_pipe.php file as follows:

first line changed to:
#!/usr/bin/php5-cgi -q

instead of what was recommended. this is the only thing that worked for me.

I also had to change my user .forward to:
USERNAME,|/usr/bin/php5-cgi /var/www/pathToSite/inc/mail/hesk_pipe.php

This is probably relevant, I apologise for neglecting it before.

I should also mention that when I send mail from one user to another on the same server (using sendmail <LOCAL_USERNAME>), only the one ticket is generated...
Josebaggins
Posts: 3
Joined: Wed Jan 25, 2012 12:58 am

Re: Email pipe creating multiple tickets

Post by Josebaggins »

Any ideas?
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Email pipe creating multiple tickets

Post by Klemen »

I'm afraid not, I don't know why the mail is getting forwarded twice to the pipe. Your best bet would be to check with a server administrator with experience setting up email piping.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply