From: Timo Sirainen Date: Sun, 24 Aug 2003 10:49:14 +0000 (+0300) Subject: Added oe6-fetch-redundant-msgset workaround. X-Git-Tag: 1.1.alpha1~4378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62da0b5f36c26088e524b0bd062eb0772607aadd;p=thirdparty%2Fdovecot%2Fcore.git Added oe6-fetch-redundant-msgset workaround. --HG-- branch : HEAD --- diff --git a/dovecot-example.conf b/dovecot-example.conf index 7ce1bbe857..9314477ab2 100644 --- a/dovecot-example.conf +++ b/dovecot-example.conf @@ -202,6 +202,10 @@ # seems to think they are FETCH replies and gives user "Message no longer # in server" error. Note that OE6 still breaks even with this workaround # if synchronization is set to "Headers Only". +# oe6-fetch-redundant-msgset: +# If client requests "nextuid:*" messageset, don't return the last message +# as RFC3501 would require. This may considerably improve Dovecot's caching +# decisions for OE6 users. # outlook-idle: # Outlook and Outlook Express never abort IDLE command, so if no mail # arrives in half a hour, Dovecot closes the connection. This is still diff --git a/src/lib-storage/index/index-messageset.c b/src/lib-storage/index/index-messageset.c index bf3bfd8efb..9232735a71 100644 --- a/src/lib-storage/index/index-messageset.c +++ b/src/lib-storage/index/index-messageset.c @@ -160,6 +160,14 @@ static int messageset_parse_next(struct messageset_context *ctx) return FALSE; } + if ((client_workarounds & WORKAROUND_OE6_FETCH_REDUNDANT_MSGSET) != 0 && + ctx->uidset && ctx->num1 == ctx->ibox->index->header->next_uid && + ctx->num2 == (unsigned int)-1) { + /* FETCH nextuid:* - it's very unlikely the client wants to + fetch the last message */ + ctx->num2 = ctx->num1; + } + if (ctx->num1 > ctx->num2) { /* swap, as specified by RFC-3501 */ unsigned int temp = ctx->num1; diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index a8d3ce964e..54f935894e 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -23,6 +23,7 @@ struct client_workaround_list { struct client_workaround_list client_workaround_list[] = { { "oe6-fetch-no-newmail", WORKAROUND_OE6_FETCH_NO_NEWMAIL }, + { "oe6-fetch-redundant-msgset", WORKAROUND_OE6_FETCH_REDUNDANT_MSGSET }, { "outlook-idle", WORKAROUND_OUTLOOK_IDLE }, { NULL, 0 } }; diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index 9e2eed7a35..7ad1267964 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -107,8 +107,9 @@ enum mail_sync_flags { }; enum client_workarounds { - WORKAROUND_OE6_FETCH_NO_NEWMAIL = 0x01, - WORKAROUND_OUTLOOK_IDLE = 0x02 + WORKAROUND_OE6_FETCH_NO_NEWMAIL = 0x01, + WORKAROUND_OE6_FETCH_REDUNDANT_MSGSET = 0x02, + WORKAROUND_OUTLOOK_IDLE = 0x04 }; struct mail_storage;