if (imap_close_mailbox (CTX_DATA) != 0) return;
CTX_DATA->state = IMAP_AUTHENTICATED;   for (i = 0; i < ctx->msgcount; i++) imap_free_header_data (&(ctx->hdrs[i]->data));
void imap_fastclose_mailbox (CONTEXT *ctx){  int i;  /* Check to see if the mailbox is actually open */  if (!ctx->data)    return;  if ((CTX_DATA->state == IMAP_SELECTED) && (ctx == CTX_DATA->selected_ctx))    if (imap_close_mailbox (CTX_DATA) != 0)      return;  for (i = 0; i < IMAP_CACHE_LEN; i++)  {    if (CTX_DATA->cache[i].path)    {      unlink (CTX_DATA->cache[i].path);      safe_free ((void **) &CTX_DATA->cache[i].path);    }  }  if (CTX_DATA->status == IMAP_BYE || CTX_DATA->status == IMAP_FATAL)  {    imap_close_connection (ctx);    CTX_DATA->conn->data = NULL;    safe_free ((void **) &ctx->data);  }}