-
-
Notifications
You must be signed in to change notification settings - Fork 828
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
Emails not sending to UTF8 recipients #1026
Comments
Can you get the EHLO response from the SMTP server using the ProtocolLogger? new SmtpClient (new ProtocolLogger ("smtp.log")) |
|
Oh, I misunderstood the issue - I thought that the Is this email ending up being sent to the wrong person? I mean, I understand that MailKit could technically use the UTF-8 version of the address in the |
Oddly, according to the unit tests that I just wrote for this, it works fine... |
How are you calling the Send/SendAsync method? Are you passing in a custom If you aren't doing that, then that's the problem. |
As I was also saying in the original message, that was the first thing I've tried (following issue 649 and the others related). I have just tested it again and it doesn't fix it. Actually, nothing changes.
The Another example, tested with a mailinator recipient address ( Both cases tested with formatOptions {International = true} |
That's really odd because the unit tests I wrote for this work as you expect. The only difference is that I do: var options = FormatOptions.Default.Clone ();
options.International = true; |
Toggle SMTPUTF8 on if the sender or any of the recipient mailbox addresses are international. May fix issue #1026
I just modified SmtpClient to use the SMTPUTF8 extension even if FormatOptions.International isn't set if the sender or any of the recipients are International addresses (and assuming that the SMTP server advertises the SMTPUTF8 extension, obviously). I cannot reproduce the problem that you describe so I'm not sure what's going on. If the above patch doesn't fix this for you, I may need you to step through with a debugger to see if you can figure out where things are going wrong. |
How are you creating the address? Maybe that's the key to reproducing this? |
Hmmm, if I create the MailboxAddress like this, then it fails just like it does for you in your test: var mailbox = new MailboxAddress ("User Name", "[email protected]"); but if I create it like this, then it works: var mailbox = new MailboxAddress ("User Name", "úßerñ[email protected]"); |
Oops, didn't mean for it to close. That said, I suspect this might be fixed now (although your original comment suggested that I dunno... that said, what I found & fixed was certainly a bug and it would have caused this issue. |
It works now, with the build version! Those changes definitely fixed it. Could you create a release for this fix? Thanks a lot for the quickly figuring out the issue |
I can also confirm that without setting the International in formatOptions, the mail is rejected. So it is working as expected now on the build version.
We are using another library for the SmtpServer which has an extension method for casting as MailboxAddress. However, the mailboxes seem to be generated with the right encoding, and IsInternational is set to true. I've just tested on latest released version (not containing the fix), with format options set by manually initializing the MailboxAddress as you suggested |
Awesome! I'm glad my changes have fixed your issue! I'm definitely planning to make a new release very soon, but I want to (hopefully) hear back from someone else to make sure I haven't broken something for their use-case. I expect to be able to make a release this week or by no later than this coming weekend. My goal is to have everything ready to release by the end of today so as soon as I hear back, I can make a release. |
MimeKit 2.8.0 released. |
Describe the bug
We noticed that on our solution using MailKit, sending emails to UTF8 recipients is not working as expected if the non-ASCII part is in the local part of the address.
e.g.: úßerñ[email protected]
What we are seeing is that it actually tries to send the email to the Punycode converted address. For example, instead of the address from above, it will send to [email protected].
Results from the investigation on the issue:
Platform:
To Reproduce
Steps to reproduce the behavior:
Thank you,
The text was updated successfully, but these errors were encountered: