diff src/lib-storage/index/dbox/dbox-storage.c @ 8411:abd0ef855a33 HEAD

Implemented imap-response-codes draft.
author Timo Sirainen <tss@iki.fi>
date Sat, 15 Nov 2008 20:59:54 +0200
parents 155700456194
children db78eab2ba5d
line wrap: on
line diff
--- a/src/lib-storage/index/dbox/dbox-storage.c	Sat Nov 15 20:23:46 2008 +0200
+++ b/src/lib-storage/index/dbox/dbox-storage.c	Sat Nov 15 20:59:54 2008 +0200
@@ -344,7 +344,7 @@
 				     directory ? MAILBOX_LIST_PATH_TYPE_DIR :
 				     MAILBOX_LIST_PATH_TYPE_MAILBOX);
 	if (stat(path, &st) == 0) {
-		mail_storage_set_error(_storage, MAIL_ERROR_NOTPOSSIBLE,
+		mail_storage_set_error(_storage, MAIL_ERROR_EXISTS,
 				       "Mailbox already exists");
 		return -1;
 	}
@@ -355,7 +355,7 @@
 	   it. */
 	alt_path = directory ? NULL : dbox_get_alt_path(storage, path);
 	if (alt_path != NULL && stat(alt_path, &st) == 0) {
-		mail_storage_set_error(_storage, MAIL_ERROR_NOTPOSSIBLE,
+		mail_storage_set_error(_storage, MAIL_ERROR_EXISTS,
 				       "Mailbox already exists");
 		return -1;
 	}
@@ -426,7 +426,7 @@
 	}
 
 	if (!unlinked_something) {
-		mailbox_list_set_error(list, MAIL_ERROR_NOTPOSSIBLE,
+		mailbox_list_set_error(list, MAIL_ERROR_NOTFOUND,
 			t_strdup_printf("Directory %s isn't empty, "
 					"can't delete it.", name));
 		return -1;
@@ -501,7 +501,7 @@
 	else if (errno == ENOTEMPTY) {
 		if (deleted)
 			return 0;
-		mailbox_list_set_error(list, MAIL_ERROR_NOTPOSSIBLE,
+		mailbox_list_set_error(list, MAIL_ERROR_NOTFOUND,
 			t_strdup_printf("Directory %s isn't empty, "
 					"can't delete it.", name));
 	} else if (!mailbox_list_set_error_from_errno(list)) {
@@ -547,7 +547,7 @@
 	if (stat(alt_newpath, &st) == 0) {
 		/* race condition or a directory left there lying around?
 		   safest to just report error. */
-		mailbox_list_set_error(list, MAIL_ERROR_NOTPOSSIBLE,
+		mailbox_list_set_error(list, MAIL_ERROR_EXISTS,
 				       "Target mailbox already exists");
 		return -1;
 	} else if (errno != ENOENT) {