[evolution-data-server/gnome-3-26] [SMTP] Recognize rejected credentials during SASL authentication
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-26] [SMTP] Recognize rejected credentials during SASL authentication
- Date: Tue, 21 Nov 2017 08:07:23 +0000 (UTC)
commit 42e54328277d03bf30280bb6a63d09449f850cfc
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]