0 votes

Is there a way to log in IMAP client, using Windows authentication of current user, so i wount store login and password as they are same? Just like "IntegratedSecurity=true" in SQL connection string.

by

1 Answer

0 votes

If you are using Exchange in your domain you can log in using Negotiate mechanism by using Imap.LoginSSPI.

Your server must support this feature for you to be able to use it.

by (301k points)
Yes, im using Exchange, and server supports SSPI authentication.

I'v got and exception "Command Argument Error. 11" while trying to connect like that:
client.LoginSSPI();
-or-
client.LoginSSPI(Limilabs.Client.Authentication.SSPIMechanism.Negotiate);

Any suggestion what am i doing wrong?
Is your computer in the domain?

Try turning on logging:
https://www.limilabs.com/blog/logging-in-mail-dll
Yes, it is in the domain, but where to specify it?

Log:
3.0.19162.1801
Connecting to '###:###', SSL/TLS: True.
S: * OK The Microsoft Exchange IMAP4 service is ready.
C: 9B2D0000 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN SASL-IR UIDPLUS MOVE ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
S: 9B2D0000 OK CAPABILITY completed.
C: 9B2D0001 ID ("name" "Mail.dll - Trial (please purchase a license at https://www.limilabs.com/mail )" "version" "3.0.19162.1801" "vendor" "www.limilabs.com" "contact" "support@limilabs.com")
S: * ID ("name" "Microsoft.Exchange.Imap4.Imap4Server" "version" "15.1")
S: 9B2D0001 OK ID completed
C: 9B2D0002 AUTHENTICATE GSSAPI
S: 9B2D0002 BAD Command Argument Error. 11
CAPABILITY response does not indicate your server supports GSSAPI or NTLM (AUTH=GSSAPI, AUTH=NTLM is missing). I assume those are turned off.
Thanks for the advice
...