Topic by Kurt Helfrich
I have a number of teams moving into OSvC incident handling from Outlook/Exchange emails. They are really excited about being able to know how many transactions they are handling, SLA metrics, etc. - which they couldn't do with emails. They have some interesting process requirements which require knowing the TO and CC addresses in the email header, which we so. I found a couple of posts about using a regex to detect email addresses, but after examining a bunch of emails with real data, including "name in quotes"<email in angle brackets>, To and CC sections spanning multiple lines and other stuff, I'd like to find a library to parse this rather than play with regexes. I found the PHP mailparse library, which looks useful, and a wrapper for that that looks more useful, but I don't know what's available in the PHP build we get to use.
This boils down to 2 questions:
- Does anyone have a good solution for fining all the To and CC addresses in the header? Ideally, I'd like to have something like "$Parser->getHeader('to'); $from = $Parser->getHeader('cc'); $from = $Parser->getHeader('from');" that would provide arrays of the addresses that I could act on in a CPM, such as assign all To and CC addresses as secondary contacts, or maybe not create an incident if the mailbox was a CC recipient.
- Which libraries/functions are included in the PHP build used in OSvC? Which libraries/functions are forbidden? I thought about making this a separate post, but decided to include it for now.