]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3+maildir: Make sure virtual sizes always get written to dovecot-uidlist file.
authorTimo Sirainen <tss@iki.fi>
Fri, 10 Oct 2008 18:21:52 +0000 (21:21 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 10 Oct 2008 18:21:52 +0000 (21:21 +0300)
--HG--
branch : HEAD

src/lib-storage/index/maildir/maildir-mail.c
src/lib-storage/mail-storage.h
src/pop3/client.c

index 996c084189231255800f4c5adc38fea3b849f3fe..e2ebd5dbb35aa5dad7559d832555ab278a3fdeec 100644 (file)
@@ -219,7 +219,8 @@ static int maildir_get_pop3_state(struct index_mail *mail)
        if (!not_pop3_only) {
                /* either nothing is cached, or only vsize is cached. */
                mail->pop3_state = 1;
-       } else if (vsize_dec != MAIL_CACHE_DECISION_YES) {
+       } else if (vsize_dec != MAIL_CACHE_DECISION_YES &&
+                  (mail->ibox->open_flags & MAILBOX_OPEN_POP3_SESSION) == 0) {
                /* if virtual size isn't cached permanently,
                   POP3 isn't being used */
                mail->pop3_state = -1;
index cf851e527df621421c65928d44f09db9b134b918..be3158205f529139ced938b4a5e7f569ffeba66d 100644 (file)
@@ -56,6 +56,9 @@ enum mailbox_open_flags {
        MAILBOX_OPEN_NO_INDEX_FILES     = 0x10,
        /* Keep mailbox exclusively locked all the time while it's open */
        MAILBOX_OPEN_KEEP_LOCKED        = 0x20,
+       /* Enable if mailbox is used for serving POP3. This allows making
+          better caching decisions. */
+       MAILBOX_OPEN_POP3_SESSION       = 0x40
 };
 
 enum mailbox_feature {
index 4220b157cf820abcb071d7965ac077dde49899e7..0d5e679356095a16ccb78c7e491ac41b823223a4 100644 (file)
@@ -175,7 +175,7 @@ struct client *client_create(int fd_in, int fd_out, struct mail_user *user)
 
        storage = client->inbox_ns->storage;
 
-       flags = 0;
+       flags = MAILBOX_OPEN_POP3_SESSION;
        if (no_flag_updates)
                flags |= MAILBOX_OPEN_KEEP_RECENT;
        if (lock_session)