From 38b64c65cee84a70e9e399ffdd6238f626e1916a Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 30 Mar 2012 23:15:57 +0200 Subject: [PATCH] imapauth: Follow RFC more closely The IMAP RFC allows the server to announce its capabilities before replying to the LOGIN command. imapauth would misinterpret that as a failed login. The fix is to only handle lines which contain the tag ("AUTH") used for the login command. Thanks to rlpowell for reporting that imapauth doesn't work against imap.google.com and for testing the fix. Signed-off-by: Uli Schlachter --- modules/extra/imapauth.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/extra/imapauth.cpp b/modules/extra/imapauth.cpp index fcf9570f..04404614 100644 --- a/modules/extra/imapauth.cpp +++ b/modules/extra/imapauth.cpp @@ -134,7 +134,7 @@ void CIMAPSock::ReadLine(const CString& sLine) { } Write("AUTH LOGIN " + sUsername + " " + m_spAuth->GetPassword() + "\r\n"); - } else { + } else if (sLine.Left(5) == "AUTH ") { CUser* pUser = CZNC::Get().FindUser(m_spAuth->GetUsername()); if (pUser && sLine.Equals("AUTH OK", false, 7)) {