changeset 13374:54318eaada67

imapc: Use EXAMINE command when possible.
author Timo Sirainen <tss@iki.fi>
date Sun, 04 Sep 2011 10:30:21 +0300
parents 9434093229aa
children 583023c4db60
files src/lib-storage/index/imapc/imapc-storage.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/imapc/imapc-storage.c	Sun Sep 04 10:25:39 2011 +0300
+++ b/src/lib-storage/index/imapc/imapc-storage.c	Sun Sep 04 10:30:21 2011 +0300
@@ -312,6 +312,7 @@
 {
 	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 @@
 		/* 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)