dovecot-2.1: imapc: If FETCH is missing a reply, but we haven't ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 20 15:22:49 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/a15a1b1994cc
changeset: 13523:a15a1b1994cc
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 20 15:22:37 2011 +0300
description:
imapc: If FETCH is missing a reply, but we haven't seen EXPUNGE for it, do NOOP and check again.
This fixes checking if message is expunged with servers that don't
immediately send EXPUNGE during UID FETCH.

diffstat:

 src/lib-storage/index/imapc/imapc-mail.c |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r bed9bc9b9e22 -r a15a1b1994cc src/lib-storage/index/imapc/imapc-mail.c
--- a/src/lib-storage/index/imapc/imapc-mail.c	Tue Sep 20 13:34:52 2011 +0300
+++ b/src/lib-storage/index/imapc/imapc-mail.c	Tue Sep 20 15:22:37 2011 +0300
@@ -38,6 +38,7 @@
 {
 	struct imapc_mailbox *mbox = (struct imapc_mailbox *)_mail->box;
 	struct imapc_msgmap *msgmap;
+	struct imapc_simple_context sctx;
 	uint32_t lseq, rseq;
 
 	if (mbox->sync_view != NULL) {
@@ -48,6 +49,16 @@
 
 	/* check if we've received EXPUNGE for it */
 	msgmap = imapc_client_mailbox_get_msgmap(mbox->client_box);
+	if (!imapc_msgmap_uid_to_rseq(msgmap, _mail->uid, &rseq))
+		return TRUE;
+
+	/* we may be running against a server that hasn't bothered sending
+	   us an EXPUNGE. see if NOOP sends it. */
+	imapc_simple_context_init(&sctx, mbox->storage);
+	imapc_client_cmdf(mbox->storage->client, imapc_simple_callback,
+			  &sctx, "NOOP");
+	imapc_simple_run(&sctx);
+
 	return !imapc_msgmap_uid_to_rseq(msgmap, _mail->uid, &rseq);
 }
 


More information about the dovecot-cvs mailing list