Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not extract the person's name using the AddressHeader? #65

Open
zbateson opened this issue Jul 30, 2018 · 2 comments
Open

Why not extract the person's name using the AddressHeader? #65

zbateson opened this issue Jul 30, 2018 · 2 comments

Comments

@zbateson
Copy link

I noticed you've implemented an EmailAddressParser to extract the name of a person attached to an email with this comment:

We don't use the special AddressHeader class because it doesn't seem to parse the person's name at all

MMP does extract name though, but perhaps there's a bug I'm not aware of? You should be able to call:

$fromHeader->getPersonName() and $fromHeader->getValue() for name and email. To get the full list of addresses, you can call $fromHeader->getAddresses() which returns AddressPart[], which has getEmail() and getName().

I'll submit a pull request for this to see if it's an easy fix for you. I noticed you do some extra filtering and I'll try to mimic that. Unfortunately from your readme it looks like I'd need an algolia account to run locally -- if it's too much of a nuisance feel free to close this and the pull request :)

All the best!

@mnapoli
Copy link
Owner

mnapoli commented Jul 30, 2018

Thanks! Testing that there is no regression will be painful though ^^ (I need to re-run parsing on older emails). I'll keep the PR open, thanks for doing that work and I always like simplifying stuff. But I can't guarantee it will be treated soon, I'll probably test it in batch with other tasks.

@zbateson
Copy link
Author

No problem -- I also added your fallback for DateTime parsing into DateHeader in 1.0... so whenever that happens it might be worth upgrading as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants