[Commits] [SCM] claws branch, master, updated. 3.18.0-3-g4b04819b9

paul at claws-mail.org paul at claws-mail.org
Mon Jul 12 11:10:55 CEST 2021


The branch, master has been updated
       via  4b04819b967a0c16c4a351d831d3b73abcff07b5 (commit)
      from  7dd48f57d532610414e36ef997eba5f7f96fe3e4 (commit)

Summary of changes:
 src/imap.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 4b04819b967a0c16c4a351d831d3b73abcff07b5
Author: paul <paul at claws-mail.org>
Date:   Mon Jul 12 10:08:33 2021 +0100

    move OAuth2 to last place in auto auth selection
    
    IMAP: when using 'automatic' auth type, if the server offers LOGIN, GSSAPI or plaintext in addition to OAUTH2, yet OAUTH2 is unconfigured, authentication will fail. This broke previously working config

diff --git a/src/imap.c b/src/imap.c
index dd0ab1deb..93fd8e3b5 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -951,14 +951,14 @@ static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass
 			ok = imap_cmd_login(session, user, pass, "SCRAM-SHA-1");
 		if (ok == MAILIMAP_ERROR_LOGIN && imap_has_capability(session, "PLAIN"))
 			ok = imap_cmd_login(session, user, pass, "PLAIN");
-		if (ok == MAILIMAP_ERROR_LOGIN && imap_has_capability(session, "XOAUTH2"))
-			ok = imap_cmd_login(session, user, pass, "XOAUTH2");
 		if (ok == MAILIMAP_ERROR_LOGIN && imap_has_capability(session, "LOGIN"))
 			ok = imap_cmd_login(session, user, pass, "LOGIN");
 		if (ok == MAILIMAP_ERROR_LOGIN && imap_has_capability(session, "GSSAPI"))
 			ok = imap_cmd_login(session, user, pass, "GSSAPI");
 		if (ok == MAILIMAP_ERROR_LOGIN) /* we always try plaintext login before giving up */
 			ok = imap_cmd_login(session, user, pass, "plaintext");
+		if (ok == MAILIMAP_ERROR_LOGIN && imap_has_capability(session, "XOAUTH2"))
+			ok = imap_cmd_login(session, user, pass, "XOAUTH2");
 	}
 
 	if (ok == MAILIMAP_NO_ERROR)
@@ -994,6 +994,11 @@ static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass
 				     "LOGIN SASL plugin is installed.");
 		}
 
+		if (type == IMAP_AUTH_OAUTH2) {
+			ext_info = _("\n\nOAuth2 error. Check and correct your OAuth2 "
+				     "account preferences.");
+		} 
+
 		if (time(NULL) - last_login_err > 10) {
 			if (!prefs_common.no_recv_err_panel) {
 				alertpanel_error_log(_("Connection to %s failed: "

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list