summaryrefslogtreecommitdiff
path: root/pith/mailcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'pith/mailcmd.c')
-rw-r--r--pith/mailcmd.c14
1 files changed, 14 insertions, 0 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;