aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/imap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 48b4309cb..2ca87b8a0 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -1873,7 +1873,7 @@ static CURLcode imap_perform(struct connectdata *conn, bool *connected,
else if(!imap->custom && selected && imap->uid)
/* FETCH from the same mailbox */
result = imap_fetch(conn);
- else if(imap->uid)
+ else if(imap->mailbox && !selected && (imap->custom || imap->uid))
/* SELECT the mailbox */
result = imap_select(conn);
else