]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added oe6-fetch-redundant-msgset workaround.
authorTimo Sirainen <tss@iki.fi>
Sun, 24 Aug 2003 10:49:14 +0000 (13:49 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 24 Aug 2003 10:49:14 +0000 (13:49 +0300)
--HG--
branch : HEAD

dovecot-example.conf
src/lib-storage/index/index-messageset.c
src/lib-storage/mail-storage.c
src/lib-storage/mail-storage.h

index 7ce1bbe8574332321d889e5e1e9d89643698eaca..9314477ab2c9e9e6091d66440dc400cdd757591c 100644 (file)
 #     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
index bf3bfd8efb01b985eae292737e55ba6b9d29a289..9232735a718a6bd4041dcd144f9a5f5ce1010c7f 100644 (file)
@@ -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;
index a8d3ce964ebd5040fbffc8737e7e93886012ab59..54f935894e23eb96429a4a3de1f17ffb369f258c 100644 (file)
@@ -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 }
 };
index 9e2eed7a35440d729c49d97aef9bdc46ac2a7357..7ad12679642eab6a3f1e2d478c29b58e7cfba5e9 100644 (file)
@@ -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;