summaryrefslogtreecommitdiffstats
path: root/browser.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-09-06 13:17:18 -0700
committerKevin McCarthy <kevin@8t8.us>2021-09-16 14:21:52 -0700
commit8bb11afe4094d7f87267d7823b399c2f828034e4 (patch)
treea47b492230632f4fdadfb25d8981ff1160aaa397 /browser.c
parentd7d7b4b3eab50dd3d17da885832f43c64e1bd3b9 (diff)
Ensure embedded IMAP passwords are stored in context->path.
Without this, IMAP autoreconnect, background-edit Fcc, browser sticky-cursor, and sidebar "current" selection may not work properly. Change imap_qualify_path() to preserve the password if it is present in IMAP_MBOX for the generated URL. In almost all cases, DT_PATH types are run through mutt_pretty_mailbox(), which filters out the passwords, before displaying them in the UI. However there are a few cases where the context->path is displayed directly. Create a new function, mutt_buffer_remove_path_password() to remove it and display that instead.
Diffstat (limited to 'browser.c')
-rw-r--r--browser.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/browser.c b/browser.c
index 034f1ef6..18419c6e 100644
--- a/browser.c
+++ b/browser.c
@@ -640,9 +640,13 @@ static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state)
mutt_buffer_strcpy (mailbox, tmp->label);
else
{
- mutt_buffer_strcpy (mailbox, mutt_b2s (tmp->pathbuf));
if (option (OPTBROWSERABBRMAILBOXES))
+ {
+ mutt_buffer_strcpy (mailbox, mutt_b2s (tmp->pathbuf));
mutt_buffer_pretty_mailbox (mailbox);
+ }
+ else
+ mutt_buffer_remove_path_password (mailbox, mutt_b2s (tmp->pathbuf));
}
#ifdef USE_IMAP
@@ -1116,7 +1120,13 @@ void _mutt_buffer_select_file (BUFFER *f, int flags, char ***files, int *numfile
case OP_BROWSER_TELL:
if (state.entrylen)
- mutt_message("%s", state.entry[menu->current].full_path);
+ {
+ BUFFER *clean = mutt_buffer_pool_get ();
+ mutt_buffer_remove_path_password (clean,
+ state.entry[menu->current].full_path);
+ mutt_message("%s", mutt_b2s (clean));
+ mutt_buffer_pool_release (&clean);
+ }
break;
#ifdef USE_IMAP