Bug 1175242, Do not delete an existing maildir folder if asked to create, r=neil, a=rkent
authorR Kent James <rkent@caspia.com>
Mon, 07 Sep 2015 18:23:30 -0700
changeset 23106 addd9fa53b40010d10cf47615fda7c99f5d5a4d5
parent 23105 8f8ed2761bf70e9ca1708f49d2d4ce4651065ecb
child 23107 b378d2df070c803b0909466673e86980591c7ed2
push idunknown
push userunknown
push dateunknown
reviewersneil, rkent
bugs1175242
Bug 1175242, Do not delete an existing maildir folder if asked to create, r=neil, a=rkent
mailnews/local/src/nsMsgMaildirStore.cpp
--- a/mailnews/local/src/nsMsgMaildirStore.cpp
+++ b/mailnews/local/src/nsMsgMaildirStore.cpp
@@ -198,16 +198,20 @@ NS_IMETHODIMP nsMsgMaildirStore::CreateF
   rv = CreateDirectoryForFolder(path, isServer);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Make sure the new folder name is valid
   nsAutoString safeFolderName(aFolderName);
   NS_MsgHashIfNecessary(safeFolderName);
 
   path->Append(safeFolderName);
+  bool exists;
+  path->Exists(&exists);
+  if (exists) //check this because localized names are different from disk names
+    return NS_MSG_FOLDER_EXISTS;
 
   rv = CreateMaildir(path);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgFolder> child;
   // GetFlags and SetFlags in AddSubfolder will fail because we have no db at
   // this point but mFlags is set.
   rv = aParent->AddSubfolder(safeFolderName, getter_AddRefs(child));