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

Issue with parsing non-standard To address in header. #169

Open
jwp72 opened this issue May 6, 2021 · 3 comments
Open

Issue with parsing non-standard To address in header. #169

jwp72 opened this issue May 6, 2021 · 3 comments

Comments

@jwp72
Copy link

jwp72 commented May 6, 2021

Having an issue with receiving non-standard formatted to: in the header of a message from cheaper multi-function printers with a scan to e-mail function. The format is either "\"\" <[email protected]>" or "[email protected]". The first is a blank display name, and the second is just not in the correct format. When the message is received it either fails parse the to: or returns an empty response. We are only interested in the actual e-mail address, but since the response is empty we are stuck. Any ideas?

@zbateson
Copy link
Owner

zbateson commented May 10, 2021

Hi @jwp72 -- ooh, that's very interesting.

You can get the raw header value by calling $headerObj->getRawValue(). For the second format, how does it come in? Just a plain email address like To: [email protected] should be totally fine at least.

For both you should still be able to call $headerObj->getEmail() (getValue() should do the same thing on an AddressHeader like To) https://mail-mime-parser.org/api/1.3/classes/ZBateson-MailMimeParser-Header-AddressHeader.html

@jwp72
Copy link
Author

jwp72 commented Aug 16, 2021

I thought the issue was related to the format of the to: section of the header, but it seems it is bigger than that. The issue seems to happen specifically with lower end multi-function printers. There seems to be no consistency with adherence to RFC standards. The mail will deliver to standard mail servers, but it fails when we send to an endpoint that we created that uses your mime parser. We are trying to figure out how we can get some logging from your plug-in in order to determine where the issue lies.

@zbateson
Copy link
Owner

Unfortunately there's no error reporting or logging at the moment. A proposal for error reporting was made in #124 -- that and logging were hoped to be part of 2.0 but won't make it in.

Best way at the moment is to attach a debugger and see what happens, sorry.

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

No branches or pull requests

2 participants