[dovecot-cvs] dovecot/src/imap cmd-close.c, 1.17, 1.18 imap-expunge.c, 1.10, 1.11

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


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

Modified Files:
	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.18
diff -u -d -r1.17 -r1.18
--- cmd-close.c	14 Jan 2006 18:47:21 -0000	1.17
+++ cmd-close.c	1 Jul 2006 20:26:10 -0000	1.18
@@ -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.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- imap-expunge.c	16 Jun 2006 09:42:38 -0000	1.10
+++ imap-expunge.c	1 Jul 2006 20:26:10 -0000	1.11
@@ -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