dovecot-1.1: imap: Try to allow STORE for read-only mailboxes, b...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 4 22:00:53 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/b5388b21c4c2
changeset: 7805:b5388b21c4c2
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 04 15:00:47 2008 -0400
description:
imap: Try to allow STORE for read-only mailboxes, but not for EXAMINEd.

diffstat:

3 files changed, 4 insertions(+), 2 deletions(-)
src/imap/client.h     |    1 +
src/imap/cmd-select.c |    1 +
src/imap/cmd-store.c  |    4 ++--

diffs (38 lines):

diff -r 1dc2dd3cd902 -r b5388b21c4c2 src/imap/client.h
--- a/src/imap/client.h	Mon Aug 04 13:33:51 2008 -0400
+++ b/src/imap/client.h	Mon Aug 04 15:00:47 2008 -0400
@@ -91,6 +91,7 @@ struct client {
 	unsigned int destroyed:1;
 	unsigned int handling_input:1;
 	unsigned int syncing:1;
+	unsigned int mailbox_examined:1;
 	unsigned int input_skip_line:1; /* skip all the data until we've
 					   found a new line */
 };
diff -r 1dc2dd3cd902 -r b5388b21c4c2 src/imap/cmd-select.c
--- a/src/imap/cmd-select.c	Mon Aug 04 13:33:51 2008 -0400
+++ b/src/imap/cmd-select.c	Mon Aug 04 15:00:47 2008 -0400
@@ -49,6 +49,7 @@ bool cmd_select_full(struct client_comma
 	   we're not sending any expunge/exists replies too early to client */
 	client->mailbox = box;
 	client->select_counter++;
+	client->mailbox_examined = readonly;
 
 	client->messages_count = status.messages;
 	client->recent_count = status.recent;
diff -r 1dc2dd3cd902 -r b5388b21c4c2 src/imap/cmd-store.c
--- a/src/imap/cmd-store.c	Mon Aug 04 13:33:51 2008 -0400
+++ b/src/imap/cmd-store.c	Mon Aug 04 15:00:47 2008 -0400
@@ -86,10 +86,10 @@ bool cmd_store(struct client_command_con
 	if (search_arg == NULL)
 		return TRUE;
 
-	if (mailbox_is_readonly(box)) {
+	if (client->mailbox_examined) {
 		return cmd_sync(cmd, MAILBOX_SYNC_FLAG_FAST |
 				(cmd->uid ? 0 : MAILBOX_SYNC_FLAG_NO_EXPUNGES),
-				0, "OK Store ignored with read-only mailbox.");
+				0, "OK Store ignored with examined mailbox.");
 	}
 
 	t = mailbox_transaction_begin(box, !silent ? 0 :


More information about the dovecot-cvs mailing list