From 46c502938eebbaaccf080d7f7b9db675724fd46e Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Thu, 30 Sep 2004 14:48:30 +0000 Subject: [PATCH] fix 257299 in pop3 authentication fall back to user/pass if auth plain is not supported, patch by ch.ey@gmx.net, r=bienvenu,sr=mscott git-svn-id: svn://10.0.0.236/trunk@163014 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/local/src/nsPop3Protocol.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mozilla/mailnews/local/src/nsPop3Protocol.cpp b/mozilla/mailnews/local/src/nsPop3Protocol.cpp index 5903f695eb0..22eafc09b16 100644 --- a/mozilla/mailnews/local/src/nsPop3Protocol.cpp +++ b/mozilla/mailnews/local/src/nsPop3Protocol.cpp @@ -1375,13 +1375,23 @@ PRInt32 nsPop3Protocol::AuthFallback() m_pop3ConData->next_state = POP3_SEND_PASSWORD; else { - // response code received, - // login failed not because of wrong credential - if(TestFlag(POP3_STOPLOGIN) || - TestCapFlag(POP3_HAS_AUTH_RESP_CODE) && !TestFlag(POP3_AUTH_FAILURE)) + // response code received shows that login failed not because of + // wrong credential -> stop login without retry or pw dialog, only alert + if (TestFlag(POP3_STOPLOGIN)) return(Error((m_password_already_sent) ? POP3_PASSWORD_FAILURE : POP3_USERNAME_FAILURE)); + // response code received shows that server is certain about the + // credential was wrong -> no fallback, show alert and pw dialog + if (TestFlag(POP3_AUTH_FAILURE)) + { + Error((m_password_already_sent) + ? POP3_PASSWORD_FAILURE : POP3_USERNAME_FAILURE); + SetFlag(POP3_PASSWORD_FAILED); + return 0; + } + + // we have no certain response code -> fallback and try again if (m_useSecAuth) { // If one authentication failed, we're going to