Skip to content

Commit

Permalink
imapc: If initial SELECT fails, don't resend it twice on reconnect.
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen authored and GitLab committed May 19, 2017
1 parent e266d02 commit bc3309d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/lib-storage/index/imapc/imapc-storage.c
Expand Up @@ -564,12 +564,21 @@ static void imapc_mailbox_reopen(void *context)
struct imapc_command *cmd;

/* we're reconnecting and need to reopen the mailbox */
mbox->initial_sync_done = FALSE;
mbox->selecting = TRUE;
mbox->prev_skipped_rseq = 0;
mbox->prev_skipped_uid = 0;
imapc_msgmap_reset(imapc_client_mailbox_get_msgmap(mbox->client_box));

if (mbox->selecting) {
/* We reconnected during the initial SELECT/EXAMINE. It'll be
automatically resent by lib-imap-client, so we don't need to
send it again here. */
i_assert(!mbox->initial_sync_done);
return;
}

mbox->initial_sync_done = FALSE;
mbox->selecting = TRUE;

cmd = imapc_client_mailbox_cmd(mbox->client_box,
imapc_mailbox_reopen_callback, mbox);
imapc_command_set_flags(cmd, IMAPC_COMMAND_FLAG_SELECT);
Expand Down

0 comments on commit bc3309d

Please sign in to comment.