Page 2 of 2

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 19 Feb 2021, 18:11
by seanm
So I've confirmed what's happening.

The parse_from_field() function uses the following regex:

/^(?:(?P<name>.*)<|)(?P<email>(?P<local>[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+)@(?P<domain>[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*))(?:>|)$/u

against a "From:" field of:

"First Last" <name@example.com> (by way Foo Bar <foobar@company.com>)

And it doesn't match the regex. You can experiment with it here: https://regexr.com/5msr7

It then stores the raw "From:" field as the 'email' key:

'email' => $p_from_address,

This I think is a mistake. From its name and usage, the 'email' key is expected to be an email address, but a "From:" field is not guaranteed to be an exact format and as you see above can even contain two email addresses within it. I think setting null would make more sense in this branch. I'll try to create and test a patch...

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 19 Feb 2021, 18:52
by SL-Gundam
It matches properly when its ""First Last" <name@example.com>" the part after that is the issue.
It's not a situation we've ever had to deal with. But yes we need to make sure EmailReporting handles it properly.
Exchange does something similar i believe. I'll check that line to make sure we cover it properly

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 19 Feb 2021, 19:20
by SL-Gundam

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 23 Feb 2021, 20:50
by seanm
That worked, thanks!

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 10 May 2021, 19:18
by seanm
So this has all been working pretty well for me for a few weeks now, but just spotted a case of an email reply getting attached to the wrong ticket in mantis. How do I troubleshoot that? Upon examining a new email, how does it decide which existing ticket (if any) to attach it to? Does it look at the "In-Reply-To:" header? The "Subject:" header? Some combination?

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 10 May 2021, 20:16
by SL-Gundam
It depends on what options you have enabled

The subject line takes precedence over message-id

What kind of search should be used to find the issue id in the subject
Use Message-ID in Mail header to identify notes

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 10 May 2021, 20:58
by seanm
I have those two settings as 'strict' and 'yes', respectively.

The first email in the thread was titled "Problème avec la mise à jour à l'Université Laval". It created ticket 11183. My boss replied, and that got attached to 11183. The customer replied twice, and both those emails got attached. My boss replied again, and it was also attached. That email was
"Message-Id: <D7487533-3AF3-4A75-AAA1-E703DBFAF233@example.com>".

Perfect so far.

Then I replied to my boss's last email, but my reply got attached to ticket 10843, which has an entirely different subject and involves totally different people. My email had in its headers: "In-Reply-To: <D7487533-3AF3-4A75-AAA1-E703DBFAF233@example.com>" The only thing slightly different about my email was that I dropped the customer from CC because I was making a comment just for coworkers.

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 11 May 2021, 15:05
by SL-Gundam
That is weird.
An email keeps track of all the previous message id's. EmailReporting will check all of them. Not just the last one.

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 11 May 2021, 20:07
by seanm
We've just found a second occurrence, so it's probably not cosmic rays. :)

If it would help, and if you're willing, I can share the full headers of the emails that got misfiled. But not on this public forum. I could email you at the address you make your git commits from, if that's ok with you?

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 11 May 2021, 22:40
by SL-Gundam
The second one is obvious. The first one I've got some suspicions but nothing conclusive.
EmailReporting keeps a database with the message id's and the issue id's that they belong to.
If somebody replies to your email that was mapped to issue 10843 any subsequent emails will be mapped to that ID as well. So ones it goes wrong it will not stop with one email.

Here's what i need to debug this
The contents of the table "mantis_plugin_EmailReporting_msgids_table"
I will also need all raw_msg files concerning issues 11183 and 10843. It would help if you mark which issue they should have been mapped to and which issue they were actually mapped to.

You can send them to the email address from my git commits

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 13 May 2021, 21:18
by SL-Gundam
Made some changes.
This should work better.
https://github.com/mantisbt-plugins/Ema ... f6260f21b3

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 08 Nov 2023, 21:08
by tet-com@freemail.hu
Hi,
1. I am also interested about to reply only the customer, who is not assigned any project?
2. I am looking for a solution, how to setting up that a new customer can see own issues?
When a new customers register with sending his first issue, he can login, but can not see any issue.

The situation:
If a new customer send an e-mail to the Mantis using the EmailReporting Plugin, he get registered as reporter, but not assignead any project. And these is all right, I do not want to assigned any project, because I do not let him to see other issues in the project.

So how can I set up. that a reporter only can see his own issue?
Thank you

Re: Help with customer suport use case: how to reply to created tickets?

Posted: 01 Dec 2023, 07:42
by Pvirgo
SL-Gundam wrote: 13 May 2021, 21:18 Made some changes.
This should work better.
https://github.com/mantisbt-plugins/Ema ... f6260f21b3
These changes are working better, I think.