Bug 564162 Import 'Everything' of Outlook Express to existing T-Bird mailbox eliminates all existing mail in T-Bird Local Folders default folders. r/sr=bienvenu
authorPhil Lacy <philbaseless-firefox@yahoo.com>
Mon, 10 May 2010 10:10:18 +0100
changeset 5623 5df43ba3b4c68dfe41e5e85b5338045c83c50919
parent 5622 37551db7fecb62b317470585a7038eaa778b6d97
child 5624 4c915bca9ba85a5f37e1564c02fc0b4389f73481
push idunknown
push userunknown
push dateunknown
bugs564162
Bug 564162 Import 'Everything' of Outlook Express to existing T-Bird mailbox eliminates all existing mail in T-Bird Local Folders default folders. r/sr=bienvenu
mailnews/import/src/nsImportMail.cpp
--- a/mailnews/import/src/nsImportMail.cpp
+++ b/mailnews/import/src/nsImportMail.cpp
@@ -1050,32 +1050,26 @@ PRBool nsImportGenericMail::CreateFolder
             folderName.Assign(name);
           else {
             IMPORT_LOG0( "*** Failed to find a unique folder name!\n");
             return PR_FALSE;
           }
         }
         IMPORT_LOG1( "Creating folder for importing mail: '%s'\n", NS_ConvertUTF16toUTF8(folderName).get());
 
-        // if we are doing migration, don't bother putting the local folders we are importing as a
-        // sub folder of local folders.
-        if (m_performingMigration)
-        {
-          NS_IF_ADDREF(*ppFolder = localRootFolder);
-          return PR_TRUE;
-        }
-        else
-        {
+        // Bug 564162 identifies a dataloss design flaw.
+        // A working Thunderbird client can have mail in Local Folders and a
+        // subsequent import 'Everything' will trigger a migration which
+        // overwrites existing mailboxes with the imported mailboxes.
         rv = localRootFolder->CreateSubfolder(folderName, nsnull);
         if (NS_SUCCEEDED(rv)) {
           rv = localRootFolder->GetChildNamed(folderName, ppFolder);
           if (*ppFolder) {
             IMPORT_LOG1("Folder '%s' created successfully\n", NS_ConvertUTF16toUTF8(folderName).get());
             return PR_TRUE;
           }
         }
-        } // if not performing migration
       }
     } // if localRootFolder
   } // if server
   IMPORT_LOG0("****** FAILED TO CREATE FOLDER FOR IMPORT\n");
   return PR_FALSE;
 }