From 119f7d8044732a400a2e69247dd7de3dc7ffbc53 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Fri, 29 Mar 2019 15:21:02 -0700 Subject: [PATCH] Change IMAP to try oauthbearer first $imap_authenticators says if it is unset, the authenticators from most-secure to secure will be tried. It makes sense for oauthbearer to come first, like with POP. To make this change backwards compatible, it depends on the previous commit, which changed imap_auth_oauth() to return IMAP_AUTH_UNAVAIL if oauth is not configured or explictily requested. Co-authored-by: Richard Russon --- imap/auth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imap/auth.c b/imap/auth.c index 7fe279844..3d5d1eed7 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -40,7 +40,7 @@ char *C_ImapAuthenticators; ///< Config: (imap) List of allowed IMAP authenticat * imap_authenticators - Accepted authentication methods */ static const struct ImapAuth imap_authenticators[] = { - { imap_auth_plain, "plain" }, + { imap_auth_oauth, "oauthbearer" }, { imap_auth_plain, "plain" }, #ifdef USE_SASL { imap_auth_sasl, NULL }, #else @@ -53,7 +53,7 @@ static const struct ImapAuth imap_authenticators[] = { #ifndef USE_SASL { imap_auth_cram_md5, "cram-md5" }, #endif - { imap_auth_login, "login" }, { imap_auth_oauth, "oauthbearer" }, + { imap_auth_login, "login" }, }; /** -- 2.40.0