[evolution-data-server] [SMTP] Recognize rejected credentials during SASL authentication



commit 8c0a49f7764669d487fec094c5b61ccbcbfd10d6
Author: Milan Crha <mcrha redhat com>
Date:   Tue Nov 21 09:02:18 2017 +0100

    [SMTP] Recognize rejected credentials during SASL authentication
    
    Instead of reporting rejected credentials when the server returned
    such code during SASL authentication cycle the code returned error
    instead, which didn't give a chance to prompt for the credentials.

 src/camel/providers/smtp/camel-smtp-transport.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/providers/smtp/camel-smtp-transport.c b/src/camel/providers/smtp/camel-smtp-transport.c
index dc39930..d249ed9 100644
--- a/src/camel/providers/smtp/camel-smtp-transport.c
+++ b/src/camel/providers/smtp/camel-smtp-transport.c
@@ -726,6 +726,10 @@ smtp_transport_authenticate_sync (CamelService *service,
 
                /* the server challenge/response should follow a 334 code */
                if (strncmp (respbuf, "334", 3) != 0) {
+                       if (strncmp (respbuf, "535", 3) == 0) {
+                               goto rejected;
+                       }
+
                        smtp_set_error (transport, istream, respbuf, cancellable, error);
                        g_prefix_error (error, _("AUTH command failed: "));
                        goto lose;
@@ -779,6 +783,7 @@ smtp_transport_authenticate_sync (CamelService *service,
        /* If our authentication data was rejected, destroy the
         * password so that the user gets prompted to try again. */
        if (strncmp (respbuf, "535", 3) == 0) {
+ rejected:
                result = CAMEL_AUTHENTICATION_REJECTED;
 
                /* Read the continuation, if the server returned it. */


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