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

Kerberos/Negotiate does not work with SmtpClient #105938

Closed
avin3sh opened this issue Aug 5, 2024 · 2 comments · Fixed by #105939
Closed

Kerberos/Negotiate does not work with SmtpClient #105938

avin3sh opened this issue Aug 5, 2024 · 2 comments · Fixed by #105939
Labels
area-System.Net in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@avin3sh
Copy link
Contributor

avin3sh commented Aug 5, 2024

Description

Kerberos with SmtpClient does not work in .NET. This isn't an issue in .NET Framework.

Reproduction Steps

Initialize SmtpClient with UseDefaultCredentials = true and try sending the mail.

Expected behavior

Negotiate should work

Actual behavior

Smtp server returns Temporary authentication failure: generic failure and on the .NET side this error appears as Command not implemented. The server response was: 5.5.2 Error: command not recognized.

Regression?

No difference when the behavior is compared with other versions

Known Workarounds

No response

Configuration

No response

Other information

If you look at the packet capture, it appears that CRLF response is being handled twice after negotiate exchange completes. This seems to be a bug because on .NET Framework there is only single CRLF response after token exchange.

image

A fix for this issue is important because MailKit, which is currently recommended in the docs, does not support Kerberos(jstedfast/MailKit#1249). Not having a functional Kerberos support in the BCL SmtpClient blocks any efforts of migrating from .NET framework.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Aug 5, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Aug 5, 2024
@avin3sh
Copy link
Contributor Author

avin3sh commented Aug 5, 2024

Opened #105939 that fixes this

@avin3sh avin3sh changed the title Kerberos/Negotiate does not work SmtpClient Kerberos/Negotiate does not work with SmtpClient Aug 5, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Aug 12, 2024
@karelz karelz added this to the 9.0.0 milestone Sep 3, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants