]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Use EXAMINE command when possible.
authorTimo Sirainen <tss@iki.fi>
Sun, 4 Sep 2011 07:30:21 +0000 (10:30 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 Sep 2011 07:30:21 +0000 (10:30 +0300)
src/lib-storage/index/imapc/imapc-storage.c

index 8b7362eca1376e368e2ea15979c111e1b15813e7..b303690d4bc215b9905de5e5a194560f70dfdee4 100644 (file)
@@ -312,6 +312,7 @@ static int imapc_mailbox_open(struct mailbox *box)
 {
        struct imapc_mailbox *mbox = (struct imapc_mailbox *)box;
        struct imapc_open_context ctx;
+       bool examine;
 
        if (index_storage_mailbox_open(box, FALSE) < 0)
                return -1;
@@ -320,13 +321,15 @@ static int imapc_mailbox_open(struct mailbox *box)
                /* We don't actually want to SELECT the mailbox. */
                return 0;
        }
+       examine = (box->flags & MAILBOX_FLAG_READONLY) != 0 &&
+               (box->flags & MAILBOX_FLAG_DROP_RECENT) == 0;
 
        mbox->opening = TRUE;
        ctx.mbox = mbox;
        ctx.ret = -2;
        mbox->client_box =
                imapc_client_mailbox_open(mbox->storage->client,
-                                         box->name, FALSE,
+                                         box->name, examine,
                                          imapc_mailbox_open_callback,
                                          &ctx, mbox);
        while (ctx.ret == -2)