-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Parse of email with brackets on from header recover an empty field. #532
Comments
This comment has been minimized.
This comment has been minimized.
If I am understanding rfc5322 correctly, the syntax is invalid:
We can see from the syntax definitions above that a That said, I don't think there would be any negative consequences for allowing square bracket characters in the name in MimeKit's parser... The only special meaning I can think of that make use of square brackets are |
Thanks for the bug report! |
But in this case, the "Name" in brackets may be invalid, but the address is normal. |
That's the goal. Most of the |
Cool, will you release a version to this? Thank you :-) |
Yea, I'm hoping to have some free time this weekend (or maybe tonight) to make a release. |
works: var displayName = "Tom Doe [Corp One]"; var mimeMessage = new MimeMessage(); mimeMessage.From.Add(new MailboxAddress(displayName, emailAddress)); No exception when sending. |
@thomas-westergard-scandinn-se This bug is about parsing, not sending. |
---- commit ac26fa6 Author: Jeffrey Stedfast <[email protected]> Date: Thu Jan 16 16:44:53 2020 -0500 Fixed mailbox address parser to be more lenient about []'s in the display-name Fixes issue jstedfast#532
Describe the bug
Using MimeMessage.Load(stream) on EML with FROM having format "[Matt] [email protected]", recover an blank From field to Message object.
Platform (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expected to see the email on "From" field but has blank text.
Screenshots
Additional context
`
To: [email protected]
Content-type: text/html; charset=UTF-8
Content-Transfer-Encoding: base64
From: [Invalid Sender] [email protected]
Message-Id: [email protected]
Date: Thu, 9 Jan 2020 11:13:09 +0900 (JST)
Subject: =?UTF-8?B?VGVzdCBzdWJqZWN0IHRvIHZhbGlkYXRlIHByb2JsZW0=?=
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFsLy9FTiI+CjxodG1sPgo8aGVhZD4KICA8dGl0bGU+TkIxPC90aXRsZT4KPC9oZWFkPgo8Ym9keT4KCTxoMT4gVGl0bGUgdGVzdCA8L2gxPgoJPHA+VGhpcyBpcyBvbmx5IGEgc2ltcGxlIEhUTUwgYm9keSB0ZXN0LjwvcD4KPC9ib2R5Pgo8L2h0bWw+Cg==
`
The text was updated successfully, but these errors were encountered: