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!