summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2022-06-02 13:05:02 -0600
committerEduardo Chappa <chappa@washington.edu>2022-06-02 13:05:02 -0600
commitf69131562a08ec43c88e8f88c3ee4d8f25b3dc54 (patch)
tree9d0f4036ccefb7a95e4a3c377e5eb233a032e60a
parent6b87c9de3ab319846baa303544084a76254d55f5 (diff)
downloadalpine-f69131562a08ec43c88e8f88c3ee4d8f25b3dc54.tar.xz
* New flag for XOAUTH2 authentication, which is needed to indicate that
we are opening a stream for the first time. This is not needed for online access but for drivers that need to open/close a connection many times.
-rw-r--r--alpine/imap.c6
-rw-r--r--alpine/xoauth2info.c10
-rw-r--r--imap/src/c-client/mail.h7
-rw-r--r--pith/pine.hlp2
4 files changed, 15 insertions, 10 deletions
diff --git a/alpine/imap.c b/alpine/imap.c
index 34905c79..55068558 100644
--- a/alpine/imap.c
+++ b/alpine/imap.c
@@ -814,9 +814,13 @@ mm_login_oauth2(NETMBX *mb, char *user, char *method,
ps_global->no_newmail_check_from_optionally_enter = 1;
/* make sure errors are seen */
- if(ps_global->ttyo && !ps_global->noshow_error)
+ if(ps_global->ttyo && !ps_global->noshow_error
+ && login && (login->flags & OA2_OPENSTREAM))
flush_status_messages(0);
+ if(login && (login->flags & OA2_OPENSTREAM))
+ login->flags |= ~OA2_OPENSTREAM;
+
token = NULL; /* start from scratch */
hostlist[0].name = mb->host;
diff --git a/alpine/xoauth2info.c b/alpine/xoauth2info.c
index b567fcfb..41632836 100644
--- a/alpine/xoauth2info.c
+++ b/alpine/xoauth2info.c
@@ -62,7 +62,7 @@ OAUTH2_S alpine_oauth2_list[] = {
0, /* first time indicator */
1, /* client secret required */
0, /* Cancel refresh token */
- GMAIL_FLAGS /* default flags. For Gmail this should be set to OA2_AUTHORIZE */
+ GMAIL_FLAGS|OA2_OPENSTREAM /* default flags. For Gmail this should be set to OA2_AUTHORIZE */
},
{OUTLOOK_NAME,
{"outlook.office365.com", "smtp.office365.com", NULL, NULL},
@@ -99,7 +99,7 @@ OAUTH2_S alpine_oauth2_list[] = {
0, /* first time indicator */
0, /* client secret required */
0, /* Cancel refresh token */
- OUTLOOK_FLAGS /* default flags. For OUTLOOK this should be set to OA2_DEVICE */
+ OUTLOOK_FLAGS|OA2_OPENSTREAM /* default flags. For OUTLOOK this should be set to OA2_DEVICE */
},
{OUTLOOK_NAME,
{"outlook.office365.com", "smtp.office365.com", NULL, NULL},
@@ -136,7 +136,7 @@ OAUTH2_S alpine_oauth2_list[] = {
0, /* first time indicator */
1, /* client secret required */
0, /* Cancel refresh token */
- OUTLOOK_FLAGS /* default flags. For OUTLOOK this should be set to OA2_DEVICE */
+ OUTLOOK_FLAGS|OA2_OPENSTREAM /* default flags. For OUTLOOK this should be set to OA2_DEVICE */
},
{YAHOO_NAME,
{"imap.mail.yahoo.com", "smtp.mail.yahoo.com", NULL, NULL},
@@ -173,7 +173,7 @@ OAUTH2_S alpine_oauth2_list[] = {
0, /* first time indicator */
1, /* client secret required */
0, /* Cancel refresh token */
- YAHOO_FLAGS /* default flags. For YAHOO this should be set to OA2_AUTHORIZE */
+ YAHOO_FLAGS|OA2_OPENSTREAM /* default flags. For YAHOO this should be set to OA2_AUTHORIZE */
},
{YANDEX_NAME,
{"imap.yandex.com", "smtp.yandex.com", NULL, NULL},
@@ -210,7 +210,7 @@ OAUTH2_S alpine_oauth2_list[] = {
0, /* first time indicator */
1, /* client secret required */
0, /* Cancel refresh token */
- YANDEX_FLAGS /* default flags. For YANDEX this should be set to OA2_AUTHORIZE */
+ YANDEX_FLAGS|OA2_OPENSTREAM /* default flags. For YANDEX this should be set to OA2_AUTHORIZE */
},
{NULL, /* Name, unsigned char * */
{NULL, NULL, NULL, NULL }, /* host and equivalents */
diff --git a/imap/src/c-client/mail.h b/imap/src/c-client/mail.h
index 6e429b00..7d1bae1d 100644
--- a/imap/src/c-client/mail.h
+++ b/imap/src/c-client/mail.h
@@ -1948,9 +1948,10 @@ int PFLUSH (void);
#define OAUTH2_TOT_EQUIV (OAUTH2_MAX_EQUIV + 2)
#define OAUTH2_PARAM_NUMBER (8)
-#define OA2_UNKNOWN 0x00 /* We do not know what method this client-id uses */
-#define OA2_DEVICE 0x01 /* Client ID obtained by client uses Device Method */
-#define OA2_AUTHORIZE 0x10 /* Client ID obtained by client uses Authorize Method */
+#define OA2_UNKNOWN 0x000 /* We do not know what method this client-id uses */
+#define OA2_DEVICE 0x001 /* Client ID obtained by client uses Device Method */
+#define OA2_AUTHORIZE 0x010 /* Client ID obtained by client uses Authorize Method */
+#define OA2_OPENSTREAM 0x100 /* We are opening a stream for the first time */
typedef enum {OA2_Id = 0,
OA2_Secret,
diff --git a/pith/pine.hlp b/pith/pine.hlp
index f9240e53..3aebbfe8 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -147,7 +147,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 647 2022-05-30 15:31:49
+Alpine Commit 648 2022-06-02 13:04:59
============= h_news =================
<HTML>
<HEAD>