[dovecot-cvs] dovecot/src/imap cmd-close.c, 1.17, 1.17.2.1 imap-expunge.c, 1.9.2.1, 1.9.2.2

cras at dovecot.org cras at dovecot.org
Sat Jul 1 23:26:11 EEST 2006


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv15090/imap

Modified Files:
      Tag: branch_1_0
	cmd-close.c imap-expunge.c 
Log Message:
Don't try to expunge messages if the mailbox is read-only. It'll just cause
our index files to go out of sync with the real mailbox and cause errors.



Index: cmd-close.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-close.c,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -u -d -r1.17 -r1.17.2.1
--- cmd-close.c	14 Jan 2006 18:47:21 -0000	1.17
+++ cmd-close.c	1 Jul 2006 20:26:08 -0000	1.17.2.1
@@ -16,10 +16,8 @@
 	storage = mailbox_get_storage(mailbox);
 	client->mailbox = NULL;
 
-	if (!mailbox_is_readonly(mailbox)) {
-		if (!imap_expunge(mailbox, NULL))
-			client_send_untagged_storage_error(client, storage);
-	}
+	if (!imap_expunge(mailbox, NULL))
+		client_send_untagged_storage_error(client, storage);
 
 	if (mailbox_close(&mailbox) < 0)
                 client_send_untagged_storage_error(client, storage);

Index: imap-expunge.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-expunge.c,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -d -r1.9.2.1 -r1.9.2.2
--- imap-expunge.c	11 Jun 2006 16:04:51 -0000	1.9.2.1
+++ imap-expunge.c	1 Jul 2006 20:26:08 -0000	1.9.2.2
@@ -14,6 +14,11 @@
         enum mailbox_sync_flags flags;
 	bool failed = FALSE;
 
+	if (mailbox_is_readonly(box)) {
+		/* silently ignore */
+		return TRUE;
+	}
+
 	memset(&search_arg, 0, sizeof(search_arg));
 	search_arg.type = SEARCH_DELETED;
 	search_arg.next = next_search_arg;



More information about the dovecot-cvs mailing list