Provide a simple email parser class to libphutil
Summary:
We do ad-hoc email address parsing in two places in Phabricator: when receiving
emails to objects (e.g., replying to a diff) and when parsing authors for
commits.
In the latter case, we don't do a very good job (see T502). Provide a simple
parser class so we can share this logic and have a sensible API around it.
I'm not trying to do the whole RFC thing since that's a gigantic mess, I think
this is sufficient for all actual email addresses that people actually receive
email at. I've allowed localpart only addresses since they generally work on
unix systems, e.g. dev/test envs.
Test Plan: Ran test cases.
Reviewers: jungejason, nh, tuomaspelkonen, aran, Makinde
Reviewed By: aran
CC: aran, epriestley
Differential Revision: 954