=?utf-8?q?=5Bevolution-data-server/gnome-3-6=5D_Bug_688639_=E2=80=93_SMTP?= =?utf-8?q?=3A_Correctly_deal_with_535_authentication_error?=



commit 77d7277d547bef1af3ddc34e53c2d12059f13c73
Author: Paul Menzel <paulepanter users sourceforge net>
Date:   Tue Nov 20 19:00:47 2012 +0100

    Bug 688639 â SMTP: Correctly deal with 535 authentication error
    
    Entering a wrong password, Evolution would fail to send messages using SMTP with the following error.
    
        Bad authentication response from server.
    
    The log file of the mail server â Exim 4 in this case â contains the following error.
    
        cram_md5_server authenticator failed for myhost.example.org ([10.10.10.10]) [xx.xxx.xxx.xxx]: 535 Incorrect authentication data (set_id=joey)
    
    Looking at the code after the rewrite in
    
        commit 68c269a66bd484768b9c1517e7dc2dd30f682485
        Author: Matthew Barnes <mbarnes redhat com>
        Date:   Sat Oct 15 09:51:35 2011 -0400
    
            smtp: Adapt to Camel's new authentication API.
    
    present since git tag EVOLUTION_DATA_SERVER_3_3_1, accidentally changed the logic not acting correctly, when receiving a 535 authentication error response and therefore was overridden by the next code block and the variable `result` changed to `CAMEL_AUTHENTICATION_ERROR` instead of `CAMEL_AUTHENTICATION_REJECTED`, which resulted in the situation where the password was not reset and therefore the user not asked to reenter it.
    
    Changing the logic, so the variable is not overridden successfully fixes the issue.

 camel/providers/smtp/camel-smtp-transport.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 1efc0fc..a107525 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -564,11 +564,10 @@ smtp_transport_authenticate_sync (CamelService *service,
 	 * password so that the user gets prompted to try again. */
 	if (strncmp (respbuf, "535", 3) == 0)
 		result = CAMEL_AUTHENTICATION_REJECTED;
-	else
+	else if (strncmp (respbuf, "235", 3) == 0)
 		result = CAMEL_AUTHENTICATION_ACCEPTED;
-
 	/* Catch any other errors. */
-	if (strncmp (respbuf, "235", 3) != 0) {
+	else {
 		g_set_error (
 			error, CAMEL_SERVICE_ERROR,
 			CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]