diff options
author | Eduardo Chappa <chappa@washington.edu> | 2021-10-23 17:48:49 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2021-10-23 17:48:49 -0600 |
commit | c0cbcd19c7475b060037d2b4682631b79fb9eb02 (patch) | |
tree | c1fdde23b21cb0adeb202a5f45e1b50f252e4a06 /pith | |
parent | 37fc53a99bbd21aa255c8e104aa7e1827e8975e2 (diff) | |
download | alpine-c0cbcd19c7475b060037d2b4682631b79fb9eb02.tar.xz |
* When alpine is authenticating using the XOAUTH2 method, servers will
close the connection if the user takes too long to set it up.
Closing the connection might confuse a user, making them believe
that the process failed, just to find the next time they open the
folder that alll is working well. With this modification alpine will
silently reopen the connection to the server after the server
closes it, and not report that the folder was closed, making it look
as if the connection was never closed and reopened.
Diffstat (limited to 'pith')
-rw-r--r-- | pith/mailcmd.c | 14 | ||||
-rw-r--r-- | pith/pine.hlp | 2 | ||||
-rw-r--r-- | pith/state.h | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/pith/mailcmd.c b/pith/mailcmd.c index e5e70e02..c53afeb4 100644 --- a/pith/mailcmd.c +++ b/pith/mailcmd.c @@ -786,12 +786,26 @@ do_broach_folder(char *newfolder, CONTEXT_S *new_context, MAILSTREAM **streamp, openmode | (open_inbox ? SP_INBOX : 0), &rflags); + if(m == NULL + && ps_global->in_xoauth2_auth + && ps_global->preserve_password){ + ps_global->in_xoauth2_auth = ps_global->user_says_cancel = ps_global->preserve_password = 0; + m = context_open((new_context && !open_inbox) ? new_context : NULL, + stream, + open_inbox ? ps_global->VAR_INBOX_PATH : expanded_file, + openmode | (open_inbox ? SP_INBOX : 0), + &rflags); + } + /* * We aren't in a situation where we want a single cancel to * apply to multiple opens. */ ps_global->user_says_cancel = 0; + /* we are not in authentication mode anymore */ + ps_global->preserve_password = ps_global->in_xoauth2_auth = 0; + if(streamp) *streamp = m; diff --git a/pith/pine.hlp b/pith/pine.hlp index ca3580c0..ed65de81 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,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 605 2021-10-22 17:11:47 +Alpine Commit 606 2021-10-23 17:48:46 ============= h_news ================= <HTML> <HEAD> diff --git a/pith/state.h b/pith/state.h index 9c6e66d1..12c5989e 100644 --- a/pith/state.h +++ b/pith/state.h @@ -145,6 +145,8 @@ struct pine { unsigned fix_fixed_warning:1; /* offer to fix it */ unsigned user_says_cancel:1; /* user typed ^C to abort open */ + unsigned in_xoauth2_auth:1; /* user is attempting xoauth2 authentication */ + unsigned preserve_password:1; /* user is saving the password */ unsigned unseen_in_view:1; unsigned start_in_context:1; /* start fldr_scrn in current cntxt */ |