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

NullReferenceException when authenticating using SaslMechanismNtlm #1148

Closed
StefanBertels opened this issue Feb 5, 2021 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@StefanBertels
Copy link

ImapClient.Authenticate(mechanism: new SaslMechanismNtlm(NetworkCredential)) throws NullReferenceException with latest MailKit

  • Windows Server 2019
  • .NET 5.0
  • MailKit 2.10.1
  • Server is Microsoft Exchange

Downgrading to Version 2.9.0 solves my issue for now (without changing anything else).
Authentication is done via user+password against Microsoft Exchange.

System.NullReferenceException: Object reference not set to an instance of an object.
   at byte[] MailKit.Security.Ntlm.Type3Message.Encode() in D:/src/MailKit/MailKit/Security/Ntlm/Type3Message.cs:line 270
   at byte[] MailKit.Security.SaslMechanismNtlm.Challenge(byte[] token, int startIndex, int length) in D:/src/MailKit/MailKit/Security/SaslMechanismNtlm.cs:line 218
   at string MailKit.Security.SaslMechanism.Challenge(string token) in D:/src/MailKit/MailKit/Security/SaslMechanism.cs:line 290
   at async Task MailKit.Net.Imap.ImapClient.AuthenticateAsync(SaslMechanism mechanism, bool doAsync, CancellationToken cancellationToken)+(?) => { } in D:/src/MailKit/MailKit/Net/Imap/ImapClient.cs:line 833
   at async Task<bool> MailKit.Net.Imap.ImapCommand.StepAsync(bool doAsync) in D:/src/MailKit/MailKit/Net/Imap/ImapCommand.cs:line 854
   at async Task MailKit.Net.Imap.ImapEngine.IterateAsync(bool doAsync) in D:/src/MailKit/MailKit/Net/Imap/ImapEngine.cs:line 2108
   at async Task MailKit.Net.Imap.ImapEngine.RunAsync(ImapCommand ic, bool doAsync) in D:/src/MailKit/MailKit/Net/Imap/ImapEngine.cs:line 2158
   at async Task MailKit.Net.Imap.ImapClient.AuthenticateAsync(SaslMechanism mechanism, bool doAsync, CancellationToken cancellationToken) in D:/src/MailKit/MailKit/Net/Imap/ImapClient.cs:line 845
   at void MailKit.Net.Imap.ImapClient.Authenticate(SaslMechanism mechanism, CancellationToken cancellationToken) in D:/src/MailKit/MailKit/Net/Imap/ImapClient.cs:line 913
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants