dovecot-1.1: pop3+maildir: Make sure virtual sizes always get wr...

dovecot at dovecot.org dovecot at dovecot.org
Fri Oct 10 21:21:03 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/589e85cab60c
changeset: 7930:589e85cab60c
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Oct 10 21:20:59 2008 +0300
description:
pop3+maildir: Make sure virtual sizes always get written to dovecot-uidlist file.

diffstat:

3 files changed, 7 insertions(+), 3 deletions(-)
src/lib-storage/index/maildir/maildir-mail.c |    3 ++-
src/lib-storage/mail-storage.h               |    5 ++++-
src/pop3/client.c                            |    2 +-

diffs (40 lines):

diff -r 0329dc4df5ed -r 589e85cab60c src/lib-storage/index/maildir/maildir-mail.c
--- a/src/lib-storage/index/maildir/maildir-mail.c	Thu Oct 09 00:08:52 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-mail.c	Fri Oct 10 21:20:59 2008 +0300
@@ -219,7 +219,8 @@ static int maildir_get_pop3_state(struct
 	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;
diff -r 0329dc4df5ed -r 589e85cab60c src/lib-storage/mail-storage.h
--- a/src/lib-storage/mail-storage.h	Thu Oct 09 00:08:52 2008 +0300
+++ b/src/lib-storage/mail-storage.h	Fri Oct 10 21:20:59 2008 +0300
@@ -54,7 +54,10 @@ enum mailbox_open_flags {
 	/* Don't create index files for the mailbox */
 	MAILBOX_OPEN_NO_INDEX_FILES	= 0x10,
 	/* Keep mailbox exclusively locked all the time while it's open */
-	MAILBOX_OPEN_KEEP_LOCKED	= 0x20
+	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_status_items {
diff -r 0329dc4df5ed -r 589e85cab60c src/pop3/client.c
--- a/src/pop3/client.c	Thu Oct 09 00:08:52 2008 +0300
+++ b/src/pop3/client.c	Fri Oct 10 21:20:59 2008 +0300
@@ -174,7 +174,7 @@ struct client *client_create(int fd_in, 
 
 	storage = client->inbox_ns->storage;
 
-	flags = 0;
+	flags = MAILBOX_OPEN_POP3_SESSION;
 	if (no_flag_updates)
 		flags |= MAILBOX_OPEN_KEEP_RECENT;
 	if (lock_session)


More information about the dovecot-cvs mailing list