mailkit imap验证失败

时间:2016-09-21 03:52:28

标签: mailkit

Connected to imap://mail.xxxxx.com:143/?starttls=when-available
S: * OK The Microsoft Exchange IMAP4 service is ready.
C: A00000000 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 LOGINDISABLED STARTTLS UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
S: A00000000 OK CAPABILITY completed.
C: A00000001 STARTTLS
S: A00000001 OK Begin TLS negotiation now.
C: A00000002 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
S: A00000002 OK CAPABILITY completed.
C: A00000003 AUTHENTICATE NTLM
S: +
C: TlRMTVNTUAABAAAABwIIAAAAAAAgAAAAAAAAACAAAAA=
S: + TlRMTVNTUAACAAAACAAIADgAAAAFAokCQ1Oy6n0KV+wAAAAAAAAAAJAAkABAAAAABgGxHQAAAA9DAE8AUgBQAAIACABDAE8AUgBQAAEABABBAEQABAAeAGMAbwByAHAALgB3AG8AcwBpAGcAbgAuAGMAbwBtAAMAJABhAGQALgBjAG8AcgBwAC4AdwBvAHMAaQBnAG4ALgBjAG8AbQAFAB4AYwBvAHIAcAAuAHcAbwBzAGkAZwBuAC4AYwBvAG0ABwAIAEgKvfK4E9IBAAAAAA==
C: TlRMTVNTUAADAAAAGAAYAGgAAAAYABgAgAAAAAAAAABIAAAAIAAgAEgAAAAAAAAAaAAAAAAAAACYAAAAAYIIAgoAWikAAAAPYwBtAHMAMQA1AEAAdwBvAHMAaQBnAG4ALgBjAG8AbQBIi1QHDf/aHwAAAAAAAAAAAAAAAAAAAAClb/du5aSYbtWcPg24wC4ZDwe68ixMp2g=
S: A00000003 NO AUTHENTICATE failed.
C: A00000004 AUTHENTICATE PLAIN
S: +
C: XXXXXXXXXXXXX
S: A00000004 NO AUTHENTICATE failed.
C: A00000005 LOGIN xxxx xxxx
S: A00000005 NO LOGIN failed.

1 个答案:

答案 0 :(得分:0)

NTLM身份验证在当前版本的MailKit 1.6.0中不起作用(嗯,它适用于某些服务器,但显然不适用于其他服务器。)

根据https://github.com/jstedfast/MailKit/issues/397,我最近提交的一个补丁理论上会解决这个问题,但我没有从提交错误的人那里回复确认它有效。

您可以从GitHub下载的源代码编译,也可以等待下一个版本。

与此同时,你可以像这样禁用NTLM身份验证:

client.AuthenticationMechanisms.Remove ("NTLM");

在致电Authenticate()之前拨打此电话。