-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
From returns blank when it contains special characters #1043
Comments
Which special characters. specifically? Are you talking about the |
Yes, just as you said, I also encountered this problem. Thank you. |
Okay, the problem is that Syntax from RFC5322:
As you can see in the syntax definitions above, a That said, MailKit already supports |
I'm not sure how these addresses are supposed to be encoded. I'm pretty sure I've typically seen them in the form Need to do more research on this... |
you are so right, they can't make up syntax out of thin air |
…t.com" If we encounter a \@ sequence, convert that to %40 when the FormatOptions.AddressParserComplianceMode value is Looser. This solution isn't ideal, but is probably the simplest option that we can do for invalid local-parts like this. The other option would be to quote the local-part, but that would be a much more involved fix because obs-local-part allows a mix of qstring and atom tokens separated by '.' in a local-part (the modern form only allows a single qstring -or- multiple atoms separated by '.'s). Because of obs-local-part, we can't just wrap the token with DQUOTEs when we finish consuming the local-part, because it *could* include 1 or more qstrings that we would have to escape. We also can't just quote individual atom tokens containing the \@ sequence, because then the esxample address above would end up being: "webmaster@custom-host".com Even though that would be syntactically valid, it's not likely to be interpreted the same. Ideally, if we were to implement a solution that quoted the relevant parts of the local-part token, it would look like this: "[email protected]" This is *doable*, but not without significant rewriting of the current TryParseLocalPart method logic. That said, even *that* might not get interpreted the as the same mailbox by whatever mail software generated the \@ sequence in the first place. (Obviously, the same goes for this %40 hack.) Fixes issue #1043
Okay, so I've added support for addresses like If the address parser encounter a This solution isn't ideal, but is probably the simplest option that we can do for invalid local-parts like this. The other option would be to quote the local-part, but that would be a much more involved fix because Because of
Even though that would be syntactically valid, it's not likely to be interpreted the same. Ideally, if we were to implement a solution that quoted the relevant parts of the This is doable, but not without significant rewriting of the current That said, even that might not get interpreted the as the same mailbox by whatever mail software generated the (Obviously, the same goes for this There may not even be a universally correct interpretation of this style of address. In other words, some mail software might accept the I wish I had more information about what software generated that address and which servers would accept what. |
I am using the latest version, and recently encountered an issue. When the From field contains special characters, it causes the From value to return as blank. Here is an example that demonstrates the issue:
The text was updated successfully, but these errors were encountered: