Bug 1243498 - Remove Eudora import. r=mkmelin
authorJorg K
Sat, 26 Mar 2016 18:02:34 +0100
changeset 24681 2ff4a7f3197d1198a6991e7b93612c509c47865d
parent 24680 16b7ef1fb00264bab3b31ef97b9e46c38a700206
child 24682 dd691b216fc1632955db2577f6db2aa05ff8f81a
push id1657
push userclokep@gmail.com
push dateMon, 06 Jun 2016 19:50:21 +0000
treeherdercomm-beta@9fac989284b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1243498
Bug 1243498 - Remove Eudora import. r=mkmelin
mail/app/profile/all-thunderbird.js
mail/components/build/nsMailComps.cpp
mail/components/migration/content/migration.xul
mail/components/migration/public/nsMailMigrationCID.h
mail/components/migration/src/moz.build
mail/components/migration/src/nsEudoraProfileMigrator.cpp
mail/components/migration/src/nsEudoraProfileMigrator.h
mail/components/migration/src/nsProfileMigrator.cpp
mail/locales/en-US/chrome/messenger/eudoraImportMsgs.properties
mail/locales/en-US/chrome/messenger/migration/migration.dtd
mail/locales/en-US/chrome/messenger/migration/migration.properties
mail/locales/jar.mn
mailnews/compose/public/nsIMsgSend.idl
mailnews/compose/src/nsMsgSend.cpp
mailnews/import/build/moz.build
mailnews/import/build/nsImportModule.cpp
mailnews/import/content/importDialog.js
mailnews/import/eudora/src/EudoraDebugLog.h
mailnews/import/eudora/src/moz.build
mailnews/import/eudora/src/nsEudoraAddress.cpp
mailnews/import/eudora/src/nsEudoraAddress.h
mailnews/import/eudora/src/nsEudoraCompose.cpp
mailnews/import/eudora/src/nsEudoraCompose.h
mailnews/import/eudora/src/nsEudoraEditor.cpp
mailnews/import/eudora/src/nsEudoraEditor.h
mailnews/import/eudora/src/nsEudoraFilters.cpp
mailnews/import/eudora/src/nsEudoraFilters.h
mailnews/import/eudora/src/nsEudoraImport.cpp
mailnews/import/eudora/src/nsEudoraImport.h
mailnews/import/eudora/src/nsEudoraMac.cpp
mailnews/import/eudora/src/nsEudoraMac.h
mailnews/import/eudora/src/nsEudoraMailbox.cpp
mailnews/import/eudora/src/nsEudoraMailbox.h
mailnews/import/eudora/src/nsEudoraSettings.cpp
mailnews/import/eudora/src/nsEudoraSettings.h
mailnews/import/eudora/src/nsEudoraStringBundle.cpp
mailnews/import/eudora/src/nsEudoraStringBundle.h
mailnews/import/eudora/src/nsEudoraWin32.cpp
mailnews/import/eudora/src/nsEudoraWin32.h
mailnews/import/public/nsIImportAddressBooks.idl
mailnews/import/test/unit/resources/import_helper.js
mailnews/moz.build
--- a/mail/app/profile/all-thunderbird.js
+++ b/mail/app/profile/all-thunderbird.js
@@ -438,17 +438,17 @@ pref("browser.helperApps.deleteTempFileO
 #endif
 
 pref("spellchecker.dictionary", "");
 // Dictionary download preference
 pref("spellchecker.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/%APP%/dictionaries/");
 
 // profile.force.migration can be used to bypass the migration wizard, forcing migration from a particular
 // mail application without any user intervention. Possible values are:
-// seamonkey (mozilla suite), eudora, oexpress, outlook.
+// seamonkey (mozilla suite), oexpress, outlook.
 pref("profile.force.migration", "");
 
 // prefs to control the mail alert notification
 pref("alerts.slideIncrementTime", 50);
 pref("alerts.totalOpenTime", 10000);
 
 // analyze urls in mail messages for scams
 pref("mail.phishing.detection.enabled", true);
--- a/mail/components/build/nsMailComps.cpp
+++ b/mail/components/build/nsMailComps.cpp
@@ -22,20 +22,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsOEProfi
 
 #include "nsOutlookProfileMigrator.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsOutlookProfileMigrator)
 
 #include "nsMailWinIntegration.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowsShellService, Init)
 #endif
 
-#if defined(XP_WIN32) || defined(XP_MACOSX)
-#include "nsEudoraProfileMigrator.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsEudoraProfileMigrator)
-#endif
 #ifdef MOZ_WIDGET_GTK
 #include "nsMailGNOMEIntegration.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMailGNOMEIntegration, Init)
 #endif
 #ifdef XP_MACOSX
 #include "nsMailMacIntegration.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMailMacIntegration)
 #endif
@@ -51,20 +47,16 @@ NS_DEFINE_NAMED_CID(NS_SEAMONKEYPROFILEM
 
 #ifdef XP_WIN32
 NS_DEFINE_NAMED_CID(NS_OEXPRESSPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_OUTLOOKPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_MAILWININTEGRATION_CID);
 NS_DEFINE_NAMED_CID(NS_MAILWINSEARCHHELPER_CID);
 #endif // !XP_WIN32
 
-#if defined (XP_WIN32) || defined (XP_MACOSX)
-NS_DEFINE_NAMED_CID(NS_EUDORAPROFILEMIGRATOR_CID);
-#endif
-
 #ifdef MOZ_WIDGET_GTK
 NS_DEFINE_NAMED_CID(NS_MAILGNOMEINTEGRATION_CID);
 #endif
 
 #ifdef XP_MACOSX
 NS_DEFINE_NAMED_CID(NS_MAILMACINTEGRATION_CID);
 #endif
 
@@ -73,19 +65,16 @@ const mozilla::Module::CIDEntry kMailCID
   { &kNS_THUNDERBIRD_PROFILEIMPORT_CID, false, NULL, nsProfileMigratorConstructor },
   { &kNS_SEAMONKEYPROFILEMIGRATOR_CID, false, NULL, nsSeamonkeyProfileMigratorConstructor },
 #ifdef XP_WIN32
   { &kNS_OEXPRESSPROFILEMIGRATOR_CID, false, NULL, nsOEProfileMigratorConstructor },
   { &kNS_OUTLOOKPROFILEMIGRATOR_CID, false, NULL, nsOutlookProfileMigratorConstructor },
   { &kNS_MAILWININTEGRATION_CID, false, NULL, nsWindowsShellServiceConstructor },
   { &kNS_MAILWINSEARCHHELPER_CID, false, NULL, nsMailWinSearchHelperConstructor },
 #endif // !XP_WIN32
-#if defined (XP_WIN32) || defined (XP_MACOSX)
-  { &kNS_EUDORAPROFILEMIGRATOR_CID, false, NULL, nsEudoraProfileMigratorConstructor },
-#endif
 #ifdef MOZ_WIDGET_GTK
   { &kNS_MAILGNOMEINTEGRATION_CID, false, NULL, nsMailGNOMEIntegrationConstructor },
 #endif
 #ifdef XP_MACOSX
   { &kNS_MAILMACINTEGRATION_CID, false, NULL, nsMailMacIntegrationConstructor },
 #endif
   { NULL }
 };
@@ -95,19 +84,16 @@ const mozilla::Module::ContractIDEntry k
   { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_THUNDERBIRD_PROFILEIMPORT_CID },
   { NS_MAILPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey", &kNS_SEAMONKEYPROFILEMIGRATOR_CID },
 #ifdef XP_WIN32
   { NS_MAILPROFILEMIGRATOR_CONTRACTID_PREFIX "oexpress", &kNS_OEXPRESSPROFILEMIGRATOR_CID },
   { NS_MAILPROFILEMIGRATOR_CONTRACTID_PREFIX "outlook", &kNS_OUTLOOKPROFILEMIGRATOR_CID },
   { "@mozilla.org/mail/shell-service;1", &kNS_MAILWININTEGRATION_CID },
   { "@mozilla.org/mail/windows-search-helper;1", &kNS_MAILWINSEARCHHELPER_CID },
 #endif // !XP_WIN32
-#if defined (XP_WIN32) || defined (XP_MACOSX)
-  { NS_MAILPROFILEMIGRATOR_CONTRACTID_PREFIX "eudora", &kNS_EUDORAPROFILEMIGRATOR_CID },
-#endif
 #ifdef MOZ_WIDGET_GTK
   { "@mozilla.org/mail/shell-service;1", &kNS_MAILGNOMEINTEGRATION_CID },
 #endif
 #ifdef XP_MACOSX
   { "@mozilla.org/mail/shell-service;1", &kNS_MAILMACINTEGRATION_CID },
 #endif
   { NULL }
 };
--- a/mail/components/migration/content/migration.xul
+++ b/mail/components/migration/content/migration.xul
@@ -35,28 +35,16 @@
              accesskey="&importFromSeamonkey3.accesskey;"/>
 
 #ifdef XP_WIN
       <radio id="oexpress"  label="&importFromOExpress.label;"  accesskey="&importFromOExpress.accesskey;"/>
       <radio id="outlook"   label="&importFromOutlook.label;"   accesskey="&importFromOutlook.accesskey;"
                             tooltiptext="Currently disabled due to bug 1175055" disabled="true"/>
 #endif
 
-#ifdef XP_UNIX
-#ifdef XP_MACOSX
-      <radio id="eudora"    label="&importFromEudora.label;"    accesskey="&importFromEudora.accesskey;"
-                            tooltiptext="Currently disabled due to bug 1175055" disabled="true"/>
-#endif
-#endif
-
-#ifdef XP_WIN
-      <radio id="eudora"    label="&importFromEudora.label;"    accesskey="&importFromEudora.accesskey;"
-                            tooltiptext="Currently disabled due to bug 1175055" disabled="true"/>
-#endif
-
       <radio id="nothing"   label="&importFromNothing.label;"   accesskey="&importFromNothing.accesskey;" hidden="true"/>
     </radiogroup>
   </wizardpage>
 
   <wizardpage id="selectProfile" pageid="selectProfile" label="&selectProfile.title;"
               next="importItems"
               onpageshow="return MigrationWizard.onSelectProfilePageShow();"
               onpagerewound="return MigrationWizard.onSelectProfilePageRewound();"
--- a/mail/components/migration/public/nsMailMigrationCID.h
+++ b/mail/components/migration/public/nsMailMigrationCID.h
@@ -7,11 +7,8 @@
 #define NS_SEAMONKEYPROFILEMIGRATOR_CID \
 { 0x62c6e1f9, 0x3dc3, 0x4b68, { 0x9c, 0x39, 0xad, 0x2f, 0x6d, 0x47, 0x1a, 0xc0 } }
 
 #define NS_OEXPRESSPROFILEMIGRATOR_CID \
 { 0xbc1db696, 0x7065, 0x46ad, { 0x87, 0x8f, 0xfd, 0x77, 0x41, 0x4e, 0x69, 0xef } }
 
 #define NS_OUTLOOKPROFILEMIGRATOR_CID \
 { 0x910b6453, 0x719, 0x41e8, { 0xa4, 0xc9, 0x3, 0x19, 0xbb, 0x34, 0xc8, 0xff } }
-
-#define NS_EUDORAPROFILEMIGRATOR_CID \
-{ 0x91622bdc, 0x3c73, 0x4474, { 0x85, 0x4, 0xac, 0xda, 0x4f, 0x1e, 0xd0, 0x68 } }
--- a/mail/components/migration/src/moz.build
+++ b/mail/components/migration/src/moz.build
@@ -7,22 +7,20 @@ SOURCES += [
     'nsMailProfileMigratorUtils.cpp',
     'nsNetscapeProfileMigratorBase.cpp',
     'nsProfileMigrator.cpp',
     'nsSeamonkeyProfileMigrator.cpp',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
-        'nsEudoraProfileMigrator.cpp',
         'nsOEProfileMigrator.cpp',
         'nsOutlookProfileMigrator.cpp',
         'nsProfileMigratorBase.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     SOURCES += [
-        'nsEudoraProfileMigrator.cpp',
         'nsProfileMigratorBase.cpp',
     ]
 
 FINAL_LIBRARY = 'mailcomps'
 
deleted file mode 100644
--- a/mail/components/migration/src/nsEudoraProfileMigrator.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsMailProfileMigratorUtils.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsIObserverService.h"
-#include "nsIPrefLocalizedString.h"
-#include "nsIPrefService.h"
-#include "nsIServiceManager.h"
-#include "nsISupportsPrimitives.h"
-#include "nsNetCID.h"
-#include "nsNetUtil.h"
-#include "nsEudoraProfileMigrator.h"
-#include "nsIProfileMigrator.h"
-#include "nsIImportSettings.h"
-#include "nsIFile.h"
-
-
-NS_IMPL_ISUPPORTS(nsEudoraProfileMigrator, nsIMailProfileMigrator, nsITimerCallback)
-
-
-nsEudoraProfileMigrator::nsEudoraProfileMigrator()
-{
-  mProcessingMailFolders = false;
-  // get the import service
-  mImportModule = do_CreateInstance("@mozilla.org/import/import-eudora;1");
-}
-
-nsEudoraProfileMigrator::~nsEudoraProfileMigrator()
-{
-}
-
-nsresult nsEudoraProfileMigrator::ContinueImport()
-{
-  return Notify(nullptr);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// nsITimerCallback
-
-NS_IMETHODIMP
-nsEudoraProfileMigrator::Notify(nsITimer *timer)
-{
-  int32_t progress;
-  mGenericImporter->GetProgress(&progress);
-
-  nsAutoString index;
-  index.AppendInt( progress );
-  NOTIFY_OBSERVERS(MIGRATION_PROGRESS, index.get());
-
-  if (progress == 100) // are we done yet?
-  {
-    if (mProcessingMailFolders)
-      return FinishCopyingMailFolders();
-    else
-      return FinishCopyingAddressBookData();
-  }
-  else
-  {
-    // fire a timer to handle the next one.
-    mFileIOTimer = do_CreateInstance("@mozilla.org/timer;1");
-    if (mFileIOTimer)
-      mFileIOTimer->InitWithCallback(static_cast<nsITimerCallback *>(this), 100, nsITimer::TYPE_ONE_SHOT);
-  }
-  return NS_OK;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// nsIMailProfileMigrator
-
-NS_IMETHODIMP
-nsEudoraProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const char16_t* aProfile)
-{
-  nsresult rv = NS_OK;
-
-  if (aStartup)
-  {
-    rv = aStartup->DoStartup();
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  NOTIFY_OBSERVERS(MIGRATION_STARTED, nullptr);
-  rv = ImportSettings(mImportModule);
-
-  // now import address books
-  // this routine will asynchronously import address book data and it will then kick off
-  // the final migration step, copying the mail folders over.
-  rv = ImportAddressBook(mImportModule);
-
-  // don't broadcast an on end migration here. We aren't done until our asynch import process says we are done.
-  return rv;
-}
-
-NS_IMETHODIMP
-nsEudoraProfileMigrator::GetMigrateData(const char16_t* aProfile,
-                                           bool aReplace,
-                                           uint16_t* aResult)
-{
-  // There's no harm in assuming everything is available.
-  *aResult = nsIMailProfileMigrator::ACCOUNT_SETTINGS | nsIMailProfileMigrator::ADDRESSBOOK_DATA |
-             nsIMailProfileMigrator::MAILDATA | nsIMailProfileMigrator::FILTERS;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsEudoraProfileMigrator::GetSourceExists(bool* aResult)
-{
-  *aResult = false;
-
-  nsCOMPtr<nsISupports> supports;
-  mImportModule->GetImportInterface(NS_IMPORT_SETTINGS_STR, getter_AddRefs(supports));
-  nsCOMPtr<nsIImportSettings> importSettings = do_QueryInterface(supports);
-
-  if (importSettings)
-  {
-    nsString description;
-    nsCOMPtr<nsIFile> location;
-    importSettings->AutoLocate(getter_Copies(description), getter_AddRefs(location), aResult);
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsEudoraProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
-{
-  *aResult = false;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsEudoraProfileMigrator::GetSourceProfiles(nsIArray** aResult)
-{
-  *aResult = nullptr;
-  return NS_OK;
-}
-
deleted file mode 100644
--- a/mail/components/migration/src/nsEudoraProfileMigrator.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef eudoraprofilemigrator___h___
-#define eudoraprofilemigrator___h___
-
-#include "nsIMailProfileMigrator.h"
-#include "nsIFile.h"
-#include "nsIObserverService.h"
-#include "nsITimer.h"
-#include "nsIImportGeneric.h"
-#include "nsIImportModule.h"
-#include "nsIMsgAccount.h"
-#include "nsProfileMigratorBase.h"
-
-class nsIFile;
-class nsIPrefBranch;
-class nsIPrefService;
-
-class nsEudoraProfileMigrator : public nsIMailProfileMigrator,
-                            public nsITimerCallback,
-                            public nsProfileMigratorBase
-{
-public:
-  NS_DECL_NSIMAILPROFILEMIGRATOR
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSITIMERCALLBACK
-
-  nsEudoraProfileMigrator();
-
-  virtual nsresult ContinueImport();
-
-private:
-  virtual ~nsEudoraProfileMigrator();
-};
-
-#endif
--- a/mail/components/migration/src/nsProfileMigrator.cpp
+++ b/mail/components/migration/src/nsProfileMigrator.cpp
@@ -108,17 +108,16 @@ nsProfileMigrator::GetDefaultMailMigrato
     return NS_OK;
   }
 
   #define MAX_SOURCE_LENGTH 10
   const char sources[][MAX_SOURCE_LENGTH] = {
     "seamonkey",
     "oexpress",
     "outlook",
-    "eudora",
     ""
   };
   for (uint32_t i = 0; sources[i][0]; ++i)
   {
     migratorID = migratorPrefix;
     migratorID.Append(sources[i]);
     mailMigrator = do_CreateInstance(migratorID.get());
     if (!mailMigrator)
deleted file mode 100644
--- a/mail/locales/en-US/chrome/messenger/eudoraImportMsgs.properties
+++ /dev/null
@@ -1,193 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#
-# The following are used by the outlook express import code to display status/error 
-# and informational messages
-#
-
-# Short name of import module
-## @name EUDORAIMPORT_NAME
-## @loc None
-2000=Eudora
-
-# Description of import module
-## @name EUDORAIMPORT_DESCRIPTION
-## @loc None
-2029=Eudora mail, address books, and settings
-
-# Success message
-## @name EUDORAIMPORT_MAILBOX_SUCCESS
-## @loc None
-# LOCALIZATION NOTE (2002): In the following sentence,
-# the %S represents a string to be inserted at runtime (the name of the Mailbox), 
-# and the %d is a number (the number of messages imported). Do not translate %d or %S, but
-# instead insert them in your text at the appropriate places.
-2002=Mailbox %S, imported %d messages
-
-# Error message
-## @name EUDORAIMPORT_MAILBOX_BADSOURCEFILE
-## @loc None
-# LOCALIZATION NOTE (2004): In the following sentence, do not translate the "%S". Instead,
-# place it in your sentence where you wish to display the name of the mailbox.
-2004=Error accessing file for mailbox %S.
-
-# Error message
-## @name EUDORAIMPORT_MAILBOX_CONVERTERROR
-## @loc None
-# LOCALIZATION NOTE (2005): In the following sentence, do not translate the "%S". Instead,
-# place it in your sentence where you wish to display the name of the mailbox.
-2005=Error importing mailbox %S, all messages may not be imported from this mailbox.
-
-# Description
-## @name EUDORAIMPORT_ACCOUNTNAME
-## @loc None
-# LOCALIZATION NOTE (2006): Do not translate "Eudora" below.
-2006=Eudora Settings
-
-# Description
-## @name EUDORAIMPORT_NICKNAMES_NAME
-## @loc None
-# LOCALIZATION NOTE (2007): Do not translate "Eudora" below.
-2007=Eudora Nicknames
-
-# Description
-## @name EUDORAIMPORT_ADDRESS_SUCCESS
-## @loc None
-# LOCALIZATION NOTE (2008): In the following sentence, do not translate the "%S". Instead,
-# place it in your sentence where you wish to display the name of the address book.
-2008=Imported address book %S
-
-# Error message
-## @name EUDORAIMPORT_ADDRESS_BADPARAM
-## @loc None
-2009=Bad parameter passed to import address book.
-
-# Error message
-## @name EUDORAIMPORT_ADDRESS_BADSOURCEFILE
-## @loc None
-# LOCALIZATION NOTE (2010): In the following sentence, do not translate the "%S". Instead,
-# place it in your sentence where you wish to display the name of the address book.
-2010=Error accessing file for address book %S.
-
-# Error message
-## @name EUDORAIMPORT_ADDRESS_CONVERTERROR
-## @loc None
-# LOCALIZATION NOTE (2011): In the following sentence, do not translate the "%S". Instead,
-# place it in your sentence where you wish to display the name of the address book.
-2011=Error importing address book %S, all addresses may not have been imported.
-
-# Description
-## @name EUDORAIMPORT_ADDRESS_LABEL_HOMEMOBILE
-## @loc None
-# LOCALIZATION NOTE (2012): In the following sentence, do not translate the "%S". Instead,
-# place it in your sentence where you wish to display the mobile phone number.
-
-2012=Personal Mobile: %S
-
-# Description
-## @name EUDORAIMPORT_ADDRESS_LABEL_WORKMOBILE
-## @loc None
-# LOCALIZATION NOTE (2013): In the following sentence, do not translate the "%S". Instead,
-# place it in your sentence where you wish to display the mobile phone number.
-
-2013=Work Mobile: %S
-
-# Description
-## @name EUDORAIMPORT_ADDRESS_LABEL_HOMEFAX
-## @loc None
-# LOCALIZATION NOTE (2014): In the following sentence, do not translate the "%S". Instead,
-# place it in your sentence where you wish to display the fax phone number.
- 
-2014=Home Fax: %S
- 
-# Description
-## @name EUDORAIMPORT_ADDRESS_LABEL_WORKFAX
-## @loc None
-# LOCALIZATION NOTE (2015): In the following sentence, do not translate the "%S". Instead,
-# place it in your sentence where you wish to display the fax phone number.
-
-2015=Work Fax: %S
-
-# Description
-## @name EUDORAIMPORT_ADDRESS_LABEL_OTHEREMAIL
-## @loc None
-
-2016=Other Email:
-
-# Description
-## @name EUDORAIMPORT_ADDRESS_LABEL_OTHERPHONE
-## @loc None
-
-2017=Other Phone:
-
-# Description
-## @name EUDORAIMPORT_ADDRESS_LABEL_OTHERWEB
-## @loc None
-
-2018=Other Web:
-
-# Description
-## @name EUDORAIMPORT_FILTERS_WARN_OUTGOING
-## @loc None
-# LOCALIZATION NOTE (2019): This warning is displayed when one of Eudora's outgoing
-# filters is attempted to be imported.  Outgoing filters are ones which are
-# processed when a message is being sent, and are not supported.
-
-2019=can't import outgoing filter context
-
-# Description
-## @name EUDORAIMPORT_FILTERS_WARN_ACTION
-## @loc None
-# LOCALIZATION NOTE (2020): This warning is displayed if the action cannot be imported.
-# The "action" is what is done to the message if the filter matches, e.g. transfer to
-# a mailbox, change the priority.  The %S will be replaced with the name of the action.
-
-2020=can't import action "%S"
-
-# Description
-## @name EUDORAIMPORT_FILTERS_WARN_VERB
-## @loc None
-# LOCALIZATION NOTE (2021): This warning is displayed if the verb cannot be imported.
-# The "verb" is how filters match the header to the text, e.g. "contains", "is",
-# "begins with".  The %s will be replaced with the name of the verb.
-
-2021=can't import the "%s" verb
-
-# Description
-## @name EUDORAIMPORT_FILTERS_WARN_EMPTY_HEADER
-## @loc None
-# LOCALIZATION NOTE (2027): This warning is displayed when the name of the header to be
-# filtered against cannot be found.
-
-2027=header name not found
-
-# Description
-## @name EUDORAIMPORT_FILTERS_WARN_NEGATE_VERB
-## @loc None
-# LOCALIZATION NOTE (2023): This warning is displayed when a filter term needs to be
-# negated, but the negative comparison is not supported, e.g. the "starts with" verb has
-# no corresponding "doesn't start with" verb.  The %S will be replaced with the name of
-# the verb.
-
-2023=can't negate the "%S" verb
-
-# Description
-## @name EUDORAIMPORT_FILTERS_WARN_META_HEADER
-## @loc None
-# LOCALIZATION NOTE (2028): This warning is displayed when one of Eudora's pseudo-headers
-# cannot be supported.  Pseudo-headers are things that can match mutiple headers, e.g.
-# "Any Header", or non-header info, e.g. "Junk Score".  The %S will be replaced with
-# the name of the pseudo-header.
-
-2028=can't import the %S pseudo-header
-
-# Description
-## @name EUDORAIMPORT_FILTERS_WARN_MAILBOX_MISSING
-## @loc None
-# LOCALIZATION NOTE (2025): This warning is displayed when a filter has an action to
-# transfer the message to a mailbox, but the named mailbox doesn't exist.  The %S will
-# be replaced with the name of the mailbox.
-
-2025=can't find the mailbox "%S"
--- a/mail/locales/en-US/chrome/messenger/migration/migration.dtd
+++ b/mail/locales/en-US/chrome/messenger/migration/migration.dtd
@@ -11,18 +11,16 @@
 <!ENTITY importFromNothing.label        "Don't import anything">
 <!ENTITY importFromNothing.accesskey    "D">
 <!ENTITY importFromSeamonkey3.label     "SeaMonkey 2 or later">
 <!ENTITY importFromSeamonkey3.accesskey "S">
 <!ENTITY importFromOExpress.label       "Outlook Express">
 <!ENTITY importFromOExpress.accesskey   "u">
 <!ENTITY importFromOutlook.label        "Outlook">
 <!ENTITY importFromOutlook.accesskey    "O">
-<!ENTITY importFromEudora.label         "Eudora">
-<!ENTITY importFromEudora.accesskey     "E">
 
 <!ENTITY importSource.title             "Import Settings and Mail Folders">
 <!ENTITY importItems.title              "Items to Import">
 <!ENTITY importItems.label              "Select which items to import:">
 
 <!ENTITY migrating.title                "Importing…">
 <!ENTITY migrating.label                "The following items are currently being imported…">
 
--- a/mail/locales/en-US/chrome/messenger/migration/migration.properties
+++ b/mail/locales/en-US/chrome/messenger/migration/migration.properties
@@ -5,29 +5,24 @@
 profileName_format=%S %S
 
 # Import Sources
 1_seamonkey=Preferences
 
 2_seamonkey=Account Settings
 2_oexpress=Account Settings
 2_outlook=Account Settings
-2_eudora=Account Settings
 
 4_seamonkey=Address Books
 4_oexpress=Address Book
 4_outlook=Address Book
-4_eudora=Address Books
 
 8_seamonkey=Junk Mail Training
 
 16_seamonkey=Saved Passwords
 
 32_seamonkey=Other Data
 
 64_seamonkey=Newsgroup Folders
 
 128_seamonkey=Mail Folders
 128_oexpress=Mail Folders
 128_outlook=Mail Folders
-128_eudora=Mail Folders
-
-256_eudora=Filters
--- a/mail/locales/jar.mn
+++ b/mail/locales/jar.mn
@@ -97,17 +97,16 @@
   locale/@AB_CD@/messenger/mailViewList.dtd                             (%chrome/messenger/mailViewList.dtd)
   locale/@AB_CD@/messenger/offlineStartup.properties                    (%chrome/messenger/offlineStartup.properties)
   locale/@AB_CD@/messenger/importMsgs.properties                        (%chrome/messenger/importMsgs.properties)
   locale/@AB_CD@/messenger/importDialog.dtd                             (%chrome/messenger/importDialog.dtd)
   locale/@AB_CD@/messenger/fieldMapImport.dtd                           (%chrome/messenger/fieldMapImport.dtd)
   locale/@AB_CD@/messenger/textImportMsgs.properties                    (%chrome/messenger/textImportMsgs.properties)
   locale/@AB_CD@/messenger/vCardImportMsgs.properties                   (%chrome/messenger/vCardImportMsgs.properties)
   locale/@AB_CD@/messenger/appleMailImportMsgs.properties               (%chrome/messenger/appleMailImportMsgs.properties)
-  locale/@AB_CD@/messenger/eudoraImportMsgs.properties                  (%chrome/messenger/eudoraImportMsgs.properties)
   locale/@AB_CD@/messenger/oeImportMsgs.properties                      (%chrome/messenger/oeImportMsgs.properties)
   locale/@AB_CD@/messenger/wmImportMsgs.properties                      (%chrome/messenger/wmImportMsgs.properties)
   locale/@AB_CD@/messenger/outlookImportMsgs.properties                 (%chrome/messenger/outlookImportMsgs.properties)
   locale/@AB_CD@/messenger/shutdownWindow.properties                    (%chrome/messenger/shutdownWindow.properties)
   locale/@AB_CD@/messenger/configEditorOverlay.dtd                      (%chrome/messenger/configEditorOverlay.dtd)
   locale/@AB_CD@/messenger/gloda.properties                             (%chrome/messenger/gloda.properties)
   locale/@AB_CD@/messenger/glodaComplete.properties                     (%chrome/messenger/glodaComplete.properties)
   locale/@AB_CD@/messenger/templateUtils.properties                     (%chrome/messenger/templateUtils.properties)
--- a/mailnews/compose/public/nsIMsgSend.idl
+++ b/mailnews/compose/public/nsIMsgSend.idl
@@ -126,17 +126,17 @@ interface nsIMsgAttachedFile : nsISuppor
   attribute unsigned long unprintableCount;
   attribute unsigned long highbitCount;
   attribute unsigned long ctlCount;
   attribute unsigned long nullCount;
   attribute unsigned long maxLineLength;
 };
 
 /**
- * This interface is used by Eudora and Outlook import to shuttle embedded
+ * This interface is used by Outlook import to shuttle embedded
  * image information over to nsIMsgSend's createRFC822Message method via
  * the aEmbbeddedObjects parameter.
  */
 [scriptable, uuid(5d2c6554-b4c8-4d68-b864-50e0df929707)]
 interface nsIMsgEmbeddedImageData : nsISupports
 {
   attribute nsIURI uri;
   attribute ACString cid;
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -1495,17 +1495,17 @@ nsMsgComposeAndSend::GetMultipartRelated
         // to process this element.
         //
         node = do_QueryElementAt(mEmbeddedObjectList, i, &rv);
         bool acceptObject = false;
         if (node)
         {
           rv = GetEmbeddedObjectInfo(node, attachment, &acceptObject);
         }
-        else // outlook/eudora import case
+        else // outlook import case
         {
           nsCOMPtr<nsIMsgEmbeddedImageData> imageData =
             do_QueryElementAt(mEmbeddedObjectList, i, &rv);
           if (!imageData)
             continue;
           acceptObject = true;
         }
         if (NS_SUCCEEDED(rv) && acceptObject)
--- a/mailnews/import/build/moz.build
+++ b/mailnews/import/build/moz.build
@@ -34,24 +34,22 @@ LOCAL_INCLUDES += [
     '../src',
     '../text/src',
     '../vcard/src',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '../applemail/src',
-        '../eudora/src',
     ]
     OS_LIBS += CONFIG['TK_LIBS']
     OS_LIBS += ['-framework Cocoa']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     LOCAL_INCLUDES += [
-        '../eudora/src',
     ]
     if not CONFIG['GNU_CC']:
         LOCAL_INCLUDES += [
             '../oexpress',
             '../outlook/src',
             '../winlivemail',
         ]
     if CONFIG['MOZ_MAPI_SUPPORT']:
--- a/mailnews/import/build/nsImportModule.cpp
+++ b/mailnews/import/build/nsImportModule.cpp
@@ -28,26 +28,16 @@ NS_DEFINE_NAMED_CID(NS_TEXTIMPORT_CID);
 ////////////////////////////////////////////////////////////////////////////////
 // vCard import Include Files
 ////////////////////////////////////////////////////////////////////////////////
 #include "nsVCardImport.h"
 
 NS_DEFINE_NAMED_CID(NS_VCARDIMPORT_CID);
 
 ////////////////////////////////////////////////////////////////////////////////
-// eudora import Include Files
-////////////////////////////////////////////////////////////////////////////////
-#if defined(XP_WIN) || defined(XP_MACOSX)
-#include "nsEudoraImport.h"
-#include "nsEudoraStringBundle.h"
-
-NS_DEFINE_NAMED_CID(NS_EUDORAIMPORT_CID);
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
 // Apple Mail import Include Files
 ////////////////////////////////////////////////////////////////////////////////
 #if defined(XP_MACOSX)
 #include "nsAppleMailImport.h"
 
 NS_DEFINE_NAMED_CID(NS_APPLEMAILIMPORT_CID);
 NS_DEFINE_NAMED_CID(NS_APPLEMAILIMPL_CID);
 #endif
@@ -84,23 +74,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsIImport
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextImport)
 
 ////////////////////////////////////////////////////////////////////////////////
 // vcard import factories
 ////////////////////////////////////////////////////////////////////////////////
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsVCardImport)
 
 ////////////////////////////////////////////////////////////////////////////////
-// eudora import factories
-////////////////////////////////////////////////////////////////////////////////
-#if defined(XP_WIN) || defined(XP_MACOSX)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsEudoraImport)
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
 // apple mail import factories
 ////////////////////////////////////////////////////////////////////////////////
 #if defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppleMailImportModule)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAppleMailImportMail, Initialize)
 #endif
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -114,19 +97,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsOutlook
 #endif
 #endif // XP_WIN
 
 static const mozilla::Module::CategoryEntry kMailNewsImportCategories[] = {
   // XXX These CIDs should match the explicit CIDs defined in the header files,
   // or be changed so that they are contract IDs (with appropriate code updates)
   { "mailnewsimport", "{A5991D01-ADA7-11d3-A9C2-00A0CC26DA63}", NS_IMPORT_ADDRESS_STR },
   { "mailnewsimport", "{0eb034a3-964a-4e2f-92eb-cc55d9ae9dd2}", NS_IMPORT_ADDRESS_STR },
-#if defined(XP_WIN) || defined(XP_MACOSX)
-  { "mailnewsimport", "{c8448da0-8f83-11d3-a206-00a0cc26da63}", kEudoraSupportsString },
-#endif
 #ifdef XP_WIN
   { "mailnewsimport", "{42bc82bc-8e9f-4597-8b6e-e529daaf3af1}", kWMSupportsString },
   { "mailnewsimport", "{be0bc880-1742-11d3-a206-00a0cc26da63}", kOESupportsString },
 #ifdef MOZ_MAPI_SUPPORT
   { "mailnewsimport", "{1DB469A0-8B00-11d3-A206-00A0CC26DA63}", kOutlookSupportsString },
 #endif
 #endif
 #if defined(XP_MACOSX)
@@ -135,19 +115,16 @@ static const mozilla::Module::CategoryEn
   { NULL }
 };
 
 const mozilla::Module::CIDEntry kMailNewsImportCIDs[] = {
   { &kNS_IMPORTSERVICE_CID, false, NULL, nsImportServiceConstructor },
   { &kNS_IMPORTMIMEENCODE_CID, false, NULL, nsIImportMimeEncodeImplConstructor },
   { &kNS_TEXTIMPORT_CID, false, NULL, nsTextImportConstructor },
   { &kNS_VCARDIMPORT_CID, false, NULL, nsVCardImportConstructor },
-#if defined(XP_WIN) || defined(XP_MACOSX)
-  { &kNS_EUDORAIMPORT_CID, false, NULL, nsEudoraImportConstructor },
-#endif
 #if defined(XP_MACOSX)
   { &kNS_APPLEMAILIMPORT_CID, false, NULL, nsAppleMailImportModuleConstructor },
   { &kNS_APPLEMAILIMPL_CID, false, NULL, nsAppleMailImportMailConstructor },
 #endif
 
 #ifdef XP_WIN
   { &kNS_OEIMPORT_CID, false, NULL, nsOEImportConstructor },
   { &kNS_WMIMPORT_CID, false, NULL, nsWMImportConstructor },
@@ -158,19 +135,16 @@ const mozilla::Module::CIDEntry kMailNew
   { NULL }
 };
 
 const mozilla::Module::ContractIDEntry kMailNewsImportContracts[] = {
   { NS_IMPORTSERVICE_CONTRACTID, &kNS_IMPORTSERVICE_CID },
   { "@mozilla.org/import/import-mimeencode;1", &kNS_IMPORTMIMEENCODE_CID },
   { "@mozilla.org/import/import-text;1", &kNS_TEXTIMPORT_CID },
   { "@mozilla.org/import/import-vcard;1", &kNS_VCARDIMPORT_CID },
-#if defined(XP_WIN) || defined(XP_MACOSX)
-  { "@mozilla.org/import/import-eudora;1", &kNS_EUDORAIMPORT_CID },
-#endif
 #if defined(XP_MACOSX)
   { "@mozilla.org/import/import-applemail;1", &kNS_APPLEMAILIMPORT_CID },
   { NS_APPLEMAILIMPL_CONTRACTID, &kNS_APPLEMAILIMPL_CID },
 #endif
 
 #ifdef XP_WIN
   { "@mozilla.org/import/import-oe;1", &kNS_OEIMPORT_CID },
   { "@mozilla.org/import/import-wm;1", &kNS_WMIMPORT_CID },
@@ -179,20 +153,16 @@ const mozilla::Module::ContractIDEntry k
 #endif
 #endif
   { NULL }
 };
 
 
 static void importModuleDtor()
 {
-#if defined(XP_WIN) || defined(XP_MACOSX)
-    nsEudoraStringBundle::Cleanup();
-#endif
-
 #ifdef XP_WIN
 
     nsOEStringBundle::Cleanup();
     nsWMStringBundle::Cleanup();
 #ifdef MOZ_MAPI_SUPPORT
     nsOutlookStringBundle::Cleanup();
 #endif
 #endif
--- a/mailnews/import/content/importDialog.js
+++ b/mailnews/import/content/importDialog.js
@@ -384,18 +384,18 @@ function ListModules() {
 
 function AddModuleToList(moduleName, index)
 {
   var body = document.getElementById("moduleList");
 
   var item = document.createElement('listitem');
   item.setAttribute('label', moduleName);
 
-  // Temporarily skip Eudora and Outlook Import which are busted (Bug 1175055).
-  if (moduleName == "Eudora" || moduleName == "Outlook") {
+  // Temporarily skip Outlook Import which are busted (Bug 1175055).
+  if (moduleName == "Outlook") {
     item.setAttribute('list-index', -1);
     item.setAttribute('disabled', true);
     item.setAttribute('tooltiptext', "Currently disabled due to bug 1175055");
   } else {
     item.setAttribute('list-index', index);
   }
   body.appendChild(item);
 }
deleted file mode 100644
--- a/mailnews/import/eudora/src/EudoraDebugLog.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef EudoraDebugLog_h___
-#define EudoraDebugLog_h___
-
-#ifdef NS_DEBUG
-#define IMPORT_DEBUG  1
-#endif
-
-// Use PR_LOG for logging.
-#include "mozilla/Logging.h"
-extern PRLogModuleInfo *EUDORALOGMODULE;  // Logging module
-
-#define IMPORT_LOG0(x)          MOZ_LOG(EUDORALOGMODULE, mozilla::LogLevel::Debug, (x))
-#define IMPORT_LOG1(x, y)       MOZ_LOG(EUDORALOGMODULE, mozilla::LogLevel::Debug, (x, y))
-#define IMPORT_LOG2(x, y, z)    MOZ_LOG(EUDORALOGMODULE, mozilla::LogLevel::Debug, (x, y, z))
-#define IMPORT_LOG3(a, b, c, d) MOZ_LOG(EUDORALOGMODULE, mozilla::LogLevel::Debug, (a, b, c, d))
-
-
-
-#endif /* EudoraDebugLog_h___ */
deleted file mode 100644
--- a/mailnews/import/eudora/src/moz.build
+++ /dev/null
@@ -1,28 +0,0 @@
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
-    'nsEudoraAddress.cpp',
-    'nsEudoraCompose.cpp',
-    'nsEudoraEditor.cpp',
-    'nsEudoraFilters.cpp',
-    'nsEudoraImport.cpp',
-    'nsEudoraMailbox.cpp',
-    'nsEudoraSettings.cpp',
-    'nsEudoraStringBundle.cpp',
-]
-
-if CONFIG['OS_ARCH'] == 'WINNT':
-    SOURCES += ['nsEudoraWin32.cpp']
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
-    SOURCES += ['nsEudoraMac.cpp']
-
-FINAL_LIBRARY = 'import'
-
-LOCAL_INCLUDES += [
-    '../../src'
-]
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraAddress.cpp
+++ /dev/null
@@ -1,1110 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsCOMPtr.h"
-#include "nsEudoraAddress.h"
-
-#include "nsIAddrDatabase.h"
-#include "mdb.h"
-#include "nsAbBaseCID.h"
-#include "nsIAbCard.h"
-#include "nsIServiceManager.h"
-#include "nsEudoraImport.h"
-#include "nsEudoraCompose.h"
-#include "nsMsgUtils.h"
-#include "nsTextFormatter.h"
-#include "nsEudoraStringBundle.h"
-#include "nsIStringBundle.h"
-#include "nsNetUtil.h"
-#include "nsILineInputStream.h"
-#include "EudoraDebugLog.h"
-
-#define  kWhitespace  " \t\b\r\n"
-
-#define ADD_FIELD_TO_DB_ROW(pdb, func, dbRow, val, uniStr)    \
-  if (!val.IsEmpty())                                         \
-  {                                                           \
-        NS_CopyNativeToUnicode(val, uniStr);                  \
-        pdb->func(dbRow, NS_ConvertUTF16toUTF8(uniStr).get());\
-  }
-
-
-// If we get a line longer than 16K it's just toooooo bad!
-#define kEudoraAddressBufferSz  (16 * 1024)
-
-
-#ifdef IMPORT_DEBUG
-void DumpAliasArray(nsTArray<CAliasEntry*>& a);
-#endif
-
-class CAliasData {
-public:
-  CAliasData() {}
-  ~CAliasData() {}
-
-  bool Process(const char *pLine, int32_t len);
-
-public:
-    nsCString   m_fullEntry;
-    nsCString   m_nickName;
-    nsCString   m_realName;
-    nsCString   m_email;
-};
-
-class CAliasEntry {
-public:
-  CAliasEntry(nsCString& name) { m_name = name;}
-  ~CAliasEntry() { EmptyList();}
-
-  void EmptyList(void) {
-    CAliasData *pData;
-    for (size_t i = 0; i < m_list.Length(); i++) {
-      pData = m_list.ElementAt(i);
-      delete pData;
-    }
-    m_list.Clear();
-  }
-
-public:
-  nsCString  m_name;
-  nsTArray<CAliasData*>  m_list;
-  nsCString  m_notes;
-};
-
-nsEudoraAddress::nsEudoraAddress()
-{
-}
-
-nsEudoraAddress::~nsEudoraAddress()
-{
-  EmptyAliases();
-}
-
-
-nsresult nsEudoraAddress::ImportAddresses(uint32_t *pBytes, bool *pAbort,
-                                          const char16_t *pName, nsIFile *pSrc,
-                                          nsIAddrDatabase *pDb, nsString& errors)
-{
-  // Open the source file for reading, read each line and process it!
-
-  EmptyAliases();
-  nsCOMPtr<nsIInputStream> inputStream;
-  nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(inputStream), pSrc);
-  if (NS_FAILED(rv)) {
-    IMPORT_LOG0("*** Error opening address file for reading\n");
-    return rv;
-  }
-
-  uint64_t bytesLeft = 0;
-
-  rv = inputStream->Available(&bytesLeft);
-  if (NS_FAILED(rv)) {
-    IMPORT_LOG0("*** Error checking address file for eof\n");
-    inputStream->Close();
-    return rv;
-  }
-
-  nsCOMPtr<nsILineInputStream> lineStream(do_QueryInterface(inputStream, &rv));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  bool more = true;
-
-  while ((!(*pAbort) && more && NS_SUCCEEDED(rv)))
-  {
-    nsCString line;
-    rv = lineStream->ReadLine(line, &more);
-    if (NS_SUCCEEDED(rv))
-    {
-      int32_t  len = line.Length();
-      ProcessLine(line.get(), len, errors);
-      if (pBytes)
-        *pBytes += (len / 2);
-    }
-  }
-  rv = inputStream->Close();
-
-  if (more)
-  {
-    IMPORT_LOG0("*** Error reading the address book, didn't reach the end\n");
-    return NS_ERROR_FAILURE;
-  }
-  // Run through the alias array and make address book entries...
-#ifdef IMPORT_DEBUG
-  DumpAliasArray(m_alias);
-#endif
-
-  BuildABCards(pBytes, pDb);
-
-  return pDb->Commit(nsAddrDBCommitType::kLargeCommit);
-  }
-
-
-int32_t nsEudoraAddress::CountWhiteSpace(const char *pLine, int32_t len)
-{
-  int32_t    cnt = 0;
-  while (len && ((*pLine == ' ') || (*pLine == '\t'))) {
-    len--;
-    pLine++;
-    cnt++;
-  }
-
-  return cnt;
-}
-
-void nsEudoraAddress::EmptyAliases(void)
-{
-  CAliasEntry *pData;
-  for (size_t i = 0; i < m_alias.Length(); i++) {
-    pData = m_alias.ElementAt(i);
-    delete pData;
-  }
-  m_alias.Clear();
-}
-
-void nsEudoraAddress::ProcessLine(const char *pLine, int32_t len, nsString& errors)
-{
-  if (len < 6)
-    return;
-
-  int32_t  cnt;
-  CAliasEntry  *pEntry;
-
-  if (!strncmp(pLine, "alias", 5)) {
-    pLine += 5;
-    len -= 5;
-    cnt = CountWhiteSpace(pLine, len);
-    if (cnt) {
-      pLine += cnt;
-      len -= cnt;
-      if ((pEntry = ProcessAlias(pLine, len, errors)) != nullptr)
-        m_alias.AppendElement(pEntry);
-    }
-  }
-  else if (!strncmp(pLine, "note", 4)) {
-    pLine += 4;
-    len -= 4;
-    cnt = CountWhiteSpace(pLine, len);
-    if (cnt) {
-      pLine += cnt;
-      len -= cnt;
-      ProcessNote(pLine, len, errors);
-    }
-  }
-
-  // as far as I know everything must be on one line
-  // if not, then I need to add a state variable.
-}
-
-int32_t nsEudoraAddress::GetAliasName(const char *pLine, int32_t len, nsCString& name)
-{
-  name.Truncate();
-  if (!len)
-    return 0;
-  const char *pStart = pLine;
-  char  end[2] = {' ', '\t'};
-  if (*pLine == '"') {
-    pLine++;
-    pStart++;
-    len--;
-    end[0] = '"';
-    end[1] = 0;
-  }
-
-  int32_t cnt = 0;
-  while (len) {
-    if ((*pLine == end[0]) || (*pLine == end[1]))
-      break;
-    len--;
-    pLine++;
-    cnt++;
-  }
-
-  if (cnt)
-    name.Append(pStart, cnt);
-
-  if (end[0] == '"') {
-    cnt++;
-    if (len && (*pLine == '"')) {
-      cnt++;
-      pLine++;
-      len--;
-    }
-  }
-
-  cnt += CountWhiteSpace(pLine, len);
-
-  return cnt;
-}
-
-
-CAliasEntry *nsEudoraAddress::ProcessAlias(const char *pLine, int32_t len, nsString& errors)
-{
-  nsCString  name;
-  int32_t    cnt = GetAliasName(pLine, len, name);
-  pLine += cnt;
-  len -= cnt;
-
-  // we have 3 known forms of addresses in Eudora
-  // 1) real name <email@address>
-  // 2) email@address
-  // 3) <email@address>
-  // 4) real name email@address
-  // 5) <email@address> (Real name)
-
-  CAliasEntry *pEntry = new CAliasEntry(name);
-  if (!cnt || !len)
-    return pEntry;
-
-  // Theoretically, an alias is just an RFC822 email adress, but it may contain
-  // an alias to another alias as the email!  I general, it appears close
-  // but unfortunately not exact so we can't use the nsIMsgHeaderParser to do
-  // the work for us!
-
-  // Very big bummer!
-
-  const char *pStart;
-  int32_t    tLen;
-  nsCString  alias;
-
-  while (len) {
-    pStart = pLine;
-    cnt = 0;
-    while (len && (*pLine != ',')) {
-      if (*pLine == '"') {
-        tLen = CountQuote(pLine, len);
-        pLine += tLen;
-        len -= tLen;
-        cnt += tLen;
-      }
-      else if (*pLine == '(') {
-        tLen = CountComment(pLine, len);
-        pLine += tLen;
-        len -= tLen;
-        cnt += tLen;
-      }
-      else if (*pLine == '<') {
-        tLen = CountAngle(pLine, len);
-        pLine += tLen;
-        len -= tLen;
-        cnt += tLen;
-      }
-      else {
-        cnt++;
-        pLine++;
-        len--;
-      }
-    }
-    if (cnt) {
-      CAliasData *pData = new CAliasData();
-      if (pData->Process(pStart, cnt))
-        pEntry->m_list.AppendElement(pData);
-      else
-        delete pData;
-    }
-
-    if (len && (*pLine == ',')) {
-      pLine++;
-      len--;
-    }
-  }
-
-  // Always return the entry even if there's no other attribute associated with the contact.
-  return pEntry;
-}
-
-
-void nsEudoraAddress::ProcessNote(const char *pLine, int32_t len, nsString& errors)
-{
-  nsCString  name;
-  int32_t    cnt = GetAliasName(pLine, len, name);
-  pLine += cnt;
-  len -= cnt;
-  if (!cnt || !len)
-    return;
-
-  // Find the alias for this note and store the note data there!
-  CAliasEntry *pEntry = nullptr;
-  int32_t  idx = FindAlias(name);
-  if (idx == -1)
-    return;
-
-  pEntry = m_alias.ElementAt(idx);
-  pEntry->m_notes.Append(pLine, len);
-  pEntry->m_notes.Trim(kWhitespace);
-}
-
-
-
-int32_t nsEudoraAddress::CountQuote(const char *pLine, int32_t len)
-{
-  if (!len)
-    return 0;
-
-  int32_t cnt = 1;
-  pLine++;
-  len--;
-
-  while (len && (*pLine != '"')) {
-    cnt++;
-    len--;
-    pLine++;
-  }
-
-  if (len)
-    cnt++;
-  return cnt;
-}
-
-
-int32_t nsEudoraAddress::CountAngle(const char *pLine, int32_t len)
-{
-  if (!len)
-    return 0;
-
-  int32_t cnt = 1;
-  pLine++;
-  len--;
-
-  while (len && (*pLine != '>')) {
-    cnt++;
-    len--;
-    pLine++;
-  }
-
-  if (len)
-    cnt++;
-  return cnt;
-}
-
-int32_t nsEudoraAddress::CountComment(const char *pLine, int32_t len)
-{
-  if (!len)
-    return 0;
-
-  int32_t  cCnt;
-  int32_t cnt = 1;
-  pLine++;
-  len--;
-
-  while (len && (*pLine != ')')) {
-    if (*pLine == '(') {
-      cCnt = CountComment(pLine, len);
-      cnt += cCnt;
-      pLine += cCnt;
-      len -= cCnt;
-    }
-    else {
-      cnt++;
-      len--;
-      pLine++;
-    }
-  }
-
-  if (len)
-    cnt++;
-  return cnt;
-}
-
-/*
-  nsCString  m_nickName;
-  nsCString  m_realName;
-  nsCString  m_email;
-*/
-
-bool CAliasData::Process(const char *pLine, int32_t len)
-{
-  // Extract any comments first!
-  nsCString  str;
-
-  const char *pStart = pLine;
-  int32_t    tCnt = 0;
-  int32_t    cnt = 0;
-  int32_t    max = len;
-  bool      endCollect = false;
-
-    // Keep track of the full entry without any processing for potential alias
-    // nickname resolution. Previously alias resolution was done with m_email,
-    // but unfortunately that doesn't work for nicknames with spaces.
-    // For example for the nickname "Joe Smith", "Smith" was being interpreted
-    // as the potential email address and placed in m_email, but routines like
-    // ResolveAlias were failing because "Smith" is not the full nickname.
-    // Now we just stash the full entry for nickname resolution before processing
-    // the line as a potential entry in its own right.
-    m_fullEntry.Append(pLine, len);
-
-  while (max) {
-    if (*pLine == '"') {
-      if (tCnt && !endCollect) {
-        str.Trim(kWhitespace);
-        if (!str.IsEmpty())
-          str.Append(" ", 1);
-        str.Append(pStart, tCnt);
-      }
-      cnt = nsEudoraAddress::CountQuote(pLine, max);
-      if ((cnt > 2) && m_realName.IsEmpty()) {
-        m_realName.Append(pLine + 1, cnt - 2);
-      }
-      pLine += cnt;
-      max -= cnt;
-      pStart = pLine;
-      tCnt = 0;
-    }
-    else if (*pLine == '<') {
-      if (tCnt && !endCollect) {
-        str.Trim(kWhitespace);
-        if (!str.IsEmpty())
-          str.Append(" ", 1);
-        str.Append(pStart, tCnt);
-      }
-      cnt = nsEudoraAddress::CountAngle(pLine, max);
-      if ((cnt > 2) && m_email.IsEmpty()) {
-        m_email.Append(pLine + 1, cnt - 2);
-      }
-      pLine += cnt;
-      max -= cnt;
-      pStart = pLine;
-      tCnt = 0;
-      endCollect = true;
-    }
-    else if (*pLine == '(') {
-      if (tCnt && !endCollect) {
-        str.Trim(kWhitespace);
-        if (!str.IsEmpty())
-          str.Append(" ", 1);
-        str.Append(pStart, tCnt);
-      }
-      cnt = nsEudoraAddress::CountComment(pLine, max);
-      if (cnt > 2) {
-        if (!m_realName.IsEmpty() && m_nickName.IsEmpty())
-          m_nickName = m_realName;
-        m_realName.Truncate();
-        m_realName.Append(pLine + 1, cnt - 2);
-      }
-      pLine += cnt;
-      max -= cnt;
-      pStart = pLine;
-      tCnt = 0;
-    }
-    else {
-      tCnt++;
-      pLine++;
-      max--;
-    }
-  }
-
-  if (tCnt) {
-    str.Trim(kWhitespace);
-    if (!str.IsEmpty())
-      str.Append(" ", 1);
-    str.Append(pStart, tCnt);
-  }
-
-  str.Trim(kWhitespace);
-
-  if (!m_realName.IsEmpty() && !m_email.IsEmpty())
-    return true;
-
-  // now we should have a string with any remaining non-delimitted text
-  // we assume that the last token is the email
-  // anything before that is realName
-  if (!m_email.IsEmpty()) {
-    m_realName = str;
-    return true;
-  }
-
-  tCnt = str.RFindChar(' ');
-  if (tCnt == -1) {
-    if (!str.IsEmpty()) {
-      m_email = str;
-      return true;
-    }
-    return false;
-  }
-
-  m_email = Substring(str, tCnt + 1);
-  m_realName = StringHead(str, tCnt);
-  m_realName.Trim(kWhitespace);
-  m_email.Trim(kWhitespace);
-
-  return !m_email.IsEmpty();
-}
-
-#ifdef IMPORT_DEBUG
-void DumpAliasArray(nsTArray<CAliasEntry*>& a)
-{
-  CAliasEntry *pEntry;
-  CAliasData *pData;
-
-  int32_t cnt = a.Length();
-  IMPORT_LOG1("Alias list size: %ld\n", cnt);
-  for (int32_t i = 0; i < cnt; i++) {
-    pEntry = a.ElementAt(i);
-    IMPORT_LOG1("\tAlias: %s\n", pEntry->m_name.get());
-    if (pEntry->m_list.Length() > 1) {
-      IMPORT_LOG1("\tList count #%ld\n", pEntry->m_list.Length());
-      for (int32_t j = 0; j < pEntry->m_list.Length(); j++) {
-        pData = pEntry->m_list.ElementAt(j);
-        IMPORT_LOG0("\t\t--------\n");
-        IMPORT_LOG1("\t\temail: %s\n", pData->m_email.get());
-        IMPORT_LOG1("\t\trealName: %s\n", pData->m_realName.get());
-        IMPORT_LOG1("\t\tnickName: %s\n", pData->m_nickName.get());
-      }
-    }
-    else if (pEntry->m_list.Length()) {
-      pData = pEntry->m_list.ElementAt(0);
-      IMPORT_LOG1("\t\temail: %s\n", pData->m_email.get());
-      IMPORT_LOG1("\t\trealName: %s\n", pData->m_realName.get());
-      IMPORT_LOG1("\t\tnickName: %s\n", pData->m_nickName.get());
-    }
-  }
-}
-#endif
-
-CAliasEntry *nsEudoraAddress::ResolveAlias(nsCString& name)
-{
-  int32_t  max = m_alias.Length();
-  CAliasEntry *pEntry;
-  for (int32_t i = 0; i < max; i++) {
-    pEntry = m_alias.ElementAt(i);
-    if (name.Equals(pEntry->m_name, nsCaseInsensitiveCStringComparator()))
-      return pEntry;
-  }
-
-  return nullptr;
-}
-
-void nsEudoraAddress::ResolveEntries(nsCString& name, nsTArray<CAliasData*>& list,
-                                     nsTArray<CAliasData*>& result, bool addResolvedEntries,
-                                     bool wasResolved, int32_t& numResolved)
-{
-    /* a safe-guard against recursive entries */
-    if (result.Length() > m_alias.Length())
-        return;
-
-    int32_t         max = list.Length();
-    int32_t         i;
-    CAliasData *    pData;
-    CAliasEntry *   pEntry;
-    for (i = 0; i < max; i++) {
-        pData = list.ElementAt(i);
-        // resolve the email to an existing alias!
-        if (!name.Equals(pData->m_email, nsCaseInsensitiveCStringComparator()) &&
-             ((pEntry = ResolveAlias(pData->m_fullEntry)) != nullptr)) {
-            // This new entry has all of the entries for this puppie.
-            // Resolve all of it's entries!
-            numResolved++;  // Track the number of entries resolved
-
-            // We pass in true for the 5th parameter so that we know that we're
-            // calling ourselves recursively.
-            ResolveEntries(pEntry->m_name,
-                           pEntry->m_list,
-                           result,
-                           addResolvedEntries,
-                           true,
-                           numResolved);
-        }
-        else if (addResolvedEntries || !wasResolved) {
-            // This is either an ordinary entry (i.e. just contains the info) or we were told
-            // to add resolved alias entries.
-            result.AppendElement(pData);
-        }
-    }
-}
-
-int32_t nsEudoraAddress::FindAlias(nsCString& name)
-{
-  CAliasEntry *  pEntry;
-  int32_t      max = m_alias.Length();
-  int32_t      i;
-
-  for (i = 0; i < max; i++) {
-    pEntry = m_alias.ElementAt(i);
-    if (pEntry->m_name == name)
-      return i;
-  }
-
-  return -1;
-}
-
-void nsEudoraAddress::BuildABCards(uint32_t *pBytes, nsIAddrDatabase *pDb)
-{
-  CAliasEntry *  pEntry;
-  int32_t      max = m_alias.Length();
-  int32_t      i;
-  nsTArray<CAliasData*>    emailList;
-  nsTArray<CAliasData*> membersArray; // Remember group members.
-  nsTArray<CAliasEntry*> groupsArray; // Remember groups.
-
-  // First off, run through the list and build person cards - groups/lists have to be done later
-  for (i = 0; i < max; i++) {
-    int32_t   numResolved = 0;
-    pEntry = m_alias.ElementAt(i);
-
-    // false for 4th parameter tells ResolveEntries not to add resolved entries (avoids
-    // duplicates as mailing lists are being resolved to other cards - the other cards that
-    // are found have already been added and don't need to be added again).
-    //
-    // false for 5th parameter tells ResolveEntries that we're calling it - it's not being
-    // called recursively by itself.
-    ResolveEntries(pEntry->m_name, pEntry->m_list, emailList, false, false, numResolved);
-
-    // Treat it as a group if there's more than one email address or if we
-    // needed to resolve one or more aliases. We treat single aliases to
-    // other aliases as a mailing list because there's no better equivalent.
-    if ((emailList.Length() > 1) || (numResolved > 0))
-    {
-      // Remember group members uniquely and add them to db later.
-      RememberGroupMembers(membersArray, emailList);
-      // Remember groups and add them to db later.
-      groupsArray.AppendElement(pEntry);
-    }
-    else
-      AddSingleCard(pEntry, emailList, pDb);
-
-    emailList.Clear();
-
-    if (pBytes) {
-      // This isn't exact but it will get us close enough
-      *pBytes += (pEntry->m_name.Length() + pEntry->m_notes.Length() + 10);
-    }
-  }
-
-  // Make sure group members exists before adding groups.
-  nsresult rv = AddGroupMembersAsCards(membersArray, pDb);
-  if (NS_FAILED(rv))
-    return;
-
-  // Now add the lists/groups (now that all cards have been added).
-  max = groupsArray.Length();
-  for (i = 0; i < max; i++)
-  {
-    int32_t   numResolved = 0;
-    pEntry = groupsArray.ElementAt(i);
-
-    // false for 4th parameter tells ResolveEntries to add resolved entries so that we
-    // can create the mailing list with references to all entries correctly.
-    //
-    // false for 5th parameter tells ResolveEntries that we're calling it - it's not being
-    // called recursively by itself.
-    ResolveEntries(pEntry->m_name, pEntry->m_list, emailList, true, false, numResolved);
-    AddSingleList(pEntry, emailList, pDb);
-    emailList.Clear();
-  }
-}
-
-void nsEudoraAddress::ExtractNoteField(nsCString& note, nsCString& value, const char *pFieldName)
-{
-  value.Truncate();
-  nsCString field("<");
-  field.Append(pFieldName);
-  field.Append(':');
-
-/*
-    this is a bit of a cheat, but there's no reason it won't work
-    fine for us, even better than Eudora in some cases!
-*/
-
-  int32_t idx = note.Find(field);
-  if (idx != -1) {
-    idx += field.Length();
-    int32_t endIdx = note.FindChar('>', idx);
-    if (endIdx == -1)
-      endIdx = note.Length() - 1;
-    value = Substring(note, idx, endIdx - idx);
-    idx -= field.Length();
-    note.Cut(idx, endIdx + 1);
-  }
-}
-
-void nsEudoraAddress::FormatExtraDataInNoteField(int32_t labelStringID, nsCString& extraData, nsString& noteUTF16)
-{
-  nsAutoString    label;
-  nsEudoraStringBundle::GetStringByID(labelStringID, label);
-
-  noteUTF16.Append(label);
-  noteUTF16.AppendLiteral("\n");
-  noteUTF16.Append(NS_ConvertASCIItoUTF16(extraData));
-  noteUTF16.AppendLiteral("\n\n");
-}
-
-void nsEudoraAddress::SanitizeValue(nsCString& val)
-{
-  MsgReplaceSubstring(val, "\n", ", ");
-  MsgReplaceChar(val, '\r', ',');
-}
-
-void nsEudoraAddress::SplitString(nsCString& val1, nsCString& val2)
-{
-  nsCString  temp;
-
-  // Find the last line if there is more than one!
-  int32_t idx = val1.RFind("\x0D\x0A");
-  int32_t  cnt = 2;
-  if (idx == -1) {
-    cnt = 1;
-    idx = val1.RFindChar(13);
-  }
-  if (idx == -1)
-    idx= val1.RFindChar(10);
-  if (idx != -1) {
-    val2 = Substring(val1, idx + cnt);
-    val1.SetLength(idx);
-    SanitizeValue(val1);
-  }
-}
-
-void nsEudoraAddress::AddSingleCard(CAliasEntry *pEntry, nsTArray<CAliasData*> &emailList, nsIAddrDatabase *pDb)
-{
-  // We always have a nickname and everything else is optional.
-  // Map both home and work related fields to our address card. Eudora
-  // fields that can't be mapped will be left in the 'note' field!
-  nsIMdbRow* newRow = nullptr;
-  pDb->GetNewRow(&newRow);
-  if (!newRow)
-    return;
-
-  nsCString                   displayName, name, firstName, lastName;
-  nsCString                   fax, secondaryFax, phone, mobile, secondaryMobile, webLink;
-  nsCString                   address, address2, city, state, zip, country;
-  nsCString                   phoneWK, webLinkWK, title, company;
-  nsCString                   addressWK, address2WK, cityWK, stateWK, zipWK, countryWK;
-  nsCString                   primaryLocation, otherPhone, otherWeb;
-  nsCString                   additionalEmail, stillMoreEmail;
-  nsCString                   note(pEntry->m_notes);
-  nsString                    noteUTF16;
-  bool                        isSecondaryMobileWorkNumber = true;
-  bool                        isSecondaryFaxWorkNumber = true;
-
-  if (!note.IsEmpty())
-  {
-    ExtractNoteField(note, fax, "fax");
-    ExtractNoteField(note, secondaryFax, "fax2");
-    ExtractNoteField(note, phone, "phone");
-    ExtractNoteField(note, mobile, "mobile");
-    ExtractNoteField(note, secondaryMobile, "mobile2");
-    ExtractNoteField(note, address, "address");
-    ExtractNoteField(note, city, "city");
-    ExtractNoteField(note, state, "state");
-    ExtractNoteField(note, zip, "zip");
-    ExtractNoteField(note, country, "country");
-    ExtractNoteField(note, name, "name");
-    ExtractNoteField(note, firstName, "first");
-    ExtractNoteField(note, lastName, "last");
-    ExtractNoteField(note, webLink, "web");
-
-    ExtractNoteField(note, addressWK, "address2");
-    ExtractNoteField(note, cityWK, "city2");
-    ExtractNoteField(note, stateWK, "state2");
-    ExtractNoteField(note, zipWK, "zip2");
-    ExtractNoteField(note, countryWK, "country2");
-    ExtractNoteField(note, phoneWK, "phone2");
-    ExtractNoteField(note, title, "title");
-    ExtractNoteField(note, company, "company");
-    ExtractNoteField(note, webLinkWK, "web2");
-
-    ExtractNoteField(note, primaryLocation, "primary");
-    ExtractNoteField(note, additionalEmail, "otheremail");
-    ExtractNoteField(note, otherPhone, "otherphone");
-    ExtractNoteField(note, otherWeb, "otherweb");
-
-    // Is there any "extra" data that we may want to format nicely and place
-    // in the notes field?
-    if (!additionalEmail.IsEmpty() || !otherPhone.IsEmpty() || !otherWeb.IsEmpty())
-    {
-      nsCString     otherNotes(note);
-
-      if (!additionalEmail.IsEmpty())
-      {
-        // Reconstitute line breaks for additional email
-        MsgReplaceSubstring(additionalEmail, "\x03", "\n");
-
-        // Try to figure out if there are multiple email addresses in additionalEmail
-        int32_t     idx = MsgFindCharInSet(additionalEmail, "\t\r\n,; ");
-
-        if (idx != -1)
-        {
-          // We found a character that indicates that there's more than one email address here.
-          // Separate out the addresses after the first one.
-          stillMoreEmail = Substring(additionalEmail, idx + 1);
-          stillMoreEmail.Trim(kWhitespace);
-
-          // Separate out the first address.
-          additionalEmail.SetLength(idx);
-        }
-
-        // If there were more than one additional email addresses store all the extra
-        // ones in the notes field, labeled nicely.
-        if (!stillMoreEmail.IsEmpty())
-          FormatExtraDataInNoteField(EUDORAIMPORT_ADDRESS_LABEL_OTHEREMAIL, stillMoreEmail, noteUTF16);
-      }
-
-      if (!otherPhone.IsEmpty())
-      {
-        // Reconstitute line breaks for other phone numbers
-        MsgReplaceSubstring(otherPhone, "\x03", "\n");
-
-        // Store other phone numbers in the notes field, labeled nicely
-        FormatExtraDataInNoteField(EUDORAIMPORT_ADDRESS_LABEL_OTHERPHONE, otherPhone, noteUTF16);
-      }
-
-      if (!otherWeb.IsEmpty())
-      {
-        // Reconstitute line breaks for other web sites
-        MsgReplaceSubstring(otherWeb, "\x03", "\n");
-
-        // Store other web sites in the notes field, labeled nicely
-        FormatExtraDataInNoteField(EUDORAIMPORT_ADDRESS_LABEL_OTHERWEB, otherWeb, noteUTF16);
-      }
-
-      noteUTF16.Append(NS_ConvertASCIItoUTF16(note));
-    }
-  }
-
-  CAliasData *pData = emailList.Length() ? emailList.ElementAt(0) : nullptr;
-
-  if (pData && !pData->m_realName.IsEmpty())
-    displayName = pData->m_realName;
-  else if (!name.IsEmpty())
-    displayName = name;
-  else
-    displayName = pEntry->m_name;
-
-  MsgReplaceSubstring(address, "\x03", "\n");
-  SplitString(address, address2);
-  MsgReplaceSubstring(note, "\x03", "\n");
-  MsgReplaceSubstring(fax, "\x03", " ");
-  MsgReplaceSubstring(secondaryFax, "\x03", " ");
-  MsgReplaceSubstring(phone, "\x03", " ");
-  MsgReplaceSubstring(name, "\x03", " ");
-  MsgReplaceSubstring(city, "\x03", " ");
-  MsgReplaceSubstring(state, "\x03", " ");
-  MsgReplaceSubstring(zip, "\x03", " ");
-  MsgReplaceSubstring(country, "\x03", " ");
-
-  MsgReplaceSubstring(addressWK, "\x03", "\n");
-  SplitString(addressWK, address2WK);
-  MsgReplaceSubstring(phoneWK, "\x03", " ");
-  MsgReplaceSubstring(cityWK, "\x03", " ");
-  MsgReplaceSubstring(stateWK, "\x03", " ");
-  MsgReplaceSubstring(zipWK, "\x03", " ");
-  MsgReplaceSubstring(countryWK, "\x03", " ");
-  MsgReplaceSubstring(title, "\x03", " ");
-  MsgReplaceSubstring(company, "\x03", " ");
-
-  if (newRow)
-  {
-    nsAutoString uniStr;
-
-    // Home related fields.
-    ADD_FIELD_TO_DB_ROW(pDb, AddDisplayName, newRow, displayName, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddNickName, newRow, pEntry->m_name, uniStr);
-    if (pData)
-      ADD_FIELD_TO_DB_ROW(pDb, AddPrimaryEmail, newRow, pData->m_email, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddFirstName, newRow, firstName, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddLastName, newRow, lastName, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddWebPage2, newRow, webLink, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddHomePhone, newRow, phone, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddHomeAddress, newRow, address, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddHomeAddress2, newRow, address2, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddHomeCity, newRow, city, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddHomeZipCode, newRow, zip, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddHomeState, newRow, state, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddHomeCountry, newRow, country, uniStr);
-
-    // Work related fields.
-    ADD_FIELD_TO_DB_ROW(pDb, AddJobTitle, newRow, title, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddCompany, newRow, company, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddWebPage1, newRow, webLinkWK, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddWorkPhone, newRow, phoneWK, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddWorkAddress, newRow, addressWK, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddWorkAddress2, newRow, address2WK, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddWorkCity, newRow, cityWK, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddWorkZipCode, newRow, zipWK, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddWorkState, newRow, stateWK, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddWorkCountry, newRow, countryWK, uniStr);
-
-    if ((primaryLocation.IsEmpty() || primaryLocation.LowerCaseEqualsLiteral("home")) &&
-         !mobile.IsEmpty())
-    {
-      // Primary location field is either specified to be "home" or is not
-      // specified and there is a home mobile number, so use that as the mobile number.
-      ADD_FIELD_TO_DB_ROW(pDb, AddCellularNumber, newRow, mobile, uniStr);
-
-      isSecondaryMobileWorkNumber = true;
-    }
-    else
-    {
-      // Primary location field is either specified to be "work" or there is no
-      // home mobile number, so use work mobile number.
-      ADD_FIELD_TO_DB_ROW(pDb, AddCellularNumber, newRow, secondaryMobile, uniStr);
-
-      // Home mobile number (if any) is the secondary mobile number
-      secondaryMobile = mobile;
-      isSecondaryMobileWorkNumber = false;
-    }
-
-    if ((primaryLocation.IsEmpty() || primaryLocation.LowerCaseEqualsLiteral("home")) &&
-         !fax.IsEmpty())
-    {
-      // Primary location field is either specified to be "home" or is not
-      // specified and there is a home fax number, so use that as the fax number.
-      ADD_FIELD_TO_DB_ROW(pDb, AddFaxNumber, newRow, fax, uniStr);
-
-      isSecondaryFaxWorkNumber = true;
-    }
-    else
-    {
-      // Primary location field is either specified to be "work" or there is no
-      // home fax number, so use work fax number.
-      ADD_FIELD_TO_DB_ROW(pDb, AddFaxNumber, newRow, secondaryFax, uniStr);
-
-      // Home fax number (if any) is the secondary fax number
-      secondaryFax = fax;
-      isSecondaryFaxWorkNumber = false;
-    }
-
-    ADD_FIELD_TO_DB_ROW(pDb, Add2ndEmail, newRow, additionalEmail, uniStr);
-
-    // Extra info fields
-    int32_t         stringID;
-    nsString        pFormat;
-    nsString        pCustomData;
-
-    // Add second mobile number, if any, to the Custom 1 field
-    if (!secondaryMobile.IsEmpty())
-    {
-      stringID = isSecondaryMobileWorkNumber ?
-                 EUDORAIMPORT_ADDRESS_LABEL_WORKMOBILE : EUDORAIMPORT_ADDRESS_LABEL_HOMEMOBILE;
-      pFormat.Adopt(nsEudoraStringBundle::GetStringByID(stringID));
-      pCustomData.Adopt(nsTextFormatter::smprintf(pFormat.get(), NS_ConvertASCIItoUTF16(secondaryMobile).get()));
-      pDb->AddCustom1(newRow, NS_ConvertUTF16toUTF8(pCustomData).get());
-    }
-
-    // Add second fax number, if any, to the Custom 2 field
-    if (!secondaryFax.IsEmpty())
-    {
-      stringID = isSecondaryFaxWorkNumber ?
-                 EUDORAIMPORT_ADDRESS_LABEL_WORKFAX : EUDORAIMPORT_ADDRESS_LABEL_HOMEFAX;
-      pFormat.Adopt(nsEudoraStringBundle::GetStringByID(stringID));
-      pCustomData.Adopt(nsTextFormatter::smprintf(pFormat.get(), NS_ConvertASCIItoUTF16(secondaryFax).get()));
-      pDb->AddCustom2(newRow, NS_ConvertUTF16toUTF8(pCustomData).get());
-    }
-
-    // Lastly, note field.
-    pDb->AddNotes(newRow, NS_ConvertUTF16toUTF8(noteUTF16).get());
-
-    pDb->AddCardRowToDB(newRow);
-
-    IMPORT_LOG1("Added card to db: %s\n", displayName.get());
-  }
-}
-
-//
-// Since there is no way to check if a card for a given email address already exists,
-// elements in 'membersArray' are make unique. So for each email address in 'emailList'
-// we check it in 'membersArray' and if it's not there then we add it to 'membersArray'.
-//
-void nsEudoraAddress::RememberGroupMembers(nsTArray<CAliasData*> &membersArray, nsTArray<CAliasData*> &emailList)
-{
-  int32_t cnt = emailList.Length();
-  CAliasData *pData;
-
-  for (int32_t i = 0; i < cnt; i++)
-  {
-    pData = emailList.ElementAt(i);
-    if (!pData)
-      continue;
-
-    int32_t memberCnt = membersArray.Length();
-    int32_t j = 0;
-    for (j = 0; j < memberCnt; j++)
-    {
-      if (pData == membersArray.ElementAt(j))
-        break;
-    }
-    if (j >= memberCnt)
-      membersArray.AppendElement(pData); // add to member list
-  }
-}
-
-nsresult nsEudoraAddress::AddGroupMembersAsCards(nsTArray<CAliasData*> &membersArray, nsIAddrDatabase *pDb)
-{
-  int32_t max = membersArray.Length();
-  CAliasData *pData;
-  nsresult rv = NS_OK;
-  nsCOMPtr <nsIMdbRow> newRow;
-  nsAutoString uniStr;
-  nsAutoCString  displayName;
-
-  for (int32_t i = 0; i < max; i++)
-  {
-    pData = membersArray.ElementAt(i);
-
-    if (!pData || (pData->m_email.IsEmpty()))
-      continue;
-
-    rv = pDb->GetNewRow(getter_AddRefs(newRow));
-    if (NS_FAILED(rv) || !newRow)
-      return rv;
-
-    if (!pData->m_realName.IsEmpty())
-      displayName = pData->m_realName;
-    else if (!pData->m_nickName.IsEmpty())
-      displayName = pData->m_nickName;
-    else
-      displayName.Truncate();
-
-    ADD_FIELD_TO_DB_ROW(pDb, AddDisplayName, newRow, displayName, uniStr);
-    ADD_FIELD_TO_DB_ROW(pDb, AddPrimaryEmail, newRow, pData->m_email, uniStr);
-    rv = pDb->AddCardRowToDB(newRow);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-  return rv;
-}
-
-nsresult nsEudoraAddress::AddSingleList(CAliasEntry *pEntry, nsTArray<CAliasData*> &emailList, nsIAddrDatabase *pDb)
-{
-  // Create a list.
-  nsCOMPtr <nsIMdbRow> newRow;
-  nsresult rv = pDb->GetNewListRow(getter_AddRefs(newRow));
-  if (NS_FAILED(rv) || !newRow)
-      return rv;
-
-  // Extract name from notes, if any
-  nsCString     name;
-
-  if (!pEntry->m_notes.IsEmpty())
-  {
-    nsCString     note(pEntry->m_notes);
-    ExtractNoteField(note, name, "name");
-  }
-
-  // If we got a name from the notes, use that for the name otherwise use the
-  // name in pEntry (which is the Eudora nickname).
-  rv = pDb->AddListName(newRow, name.IsEmpty() ? pEntry->m_name.get() : name.get());
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Add the name in pEntry as the list nickname, because it was the Eudora nickname
-  rv = pDb->AddListNickName(newRow, pEntry->m_name.get());
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Now add the members.
-  int32_t max = emailList.Length();
-  for (int32_t i = 0; i < max; i++)
-  {
-    CAliasData *pData = emailList.ElementAt(i);
-    nsAutoCString ldifValue("mail");
-    ldifValue.Append(pData->m_email);
-    rv = pDb->AddLdifListMember(newRow, ldifValue.get());
-  }
-
-  rv = pDb->AddCardRowToDB(newRow);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = pDb->AddListDirNode(newRow);
-  return rv;
-}
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraAddress.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsEudoraAddress_h__
-#define nsEudoraAddress_h__
-
-#include "nscore.h"
-#include "nsStringGlue.h"
-#include "nsTArray.h"
-#include "nsIFile.h"
-#include "nsCOMPtr.h"
-#include "nsIImportService.h"
-
-
-class nsIAddrDatabase;
-class CAliasEntry;
-class CAliasData;
-class nsIStringBundle;
-class nsIMutableArray;
-
-/////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////
-
-class nsEudoraAddress {
-public:
-  nsEudoraAddress();
-  virtual ~nsEudoraAddress();
-
-  // Things that must be overridden because they are platform specific.
-    // retrieve the mail folder
-  virtual bool      FindAddressFolder(nsIFile **pFolder) { return false;}
-    // get the list of mailboxes
-  virtual nsresult  FindAddressBooks(nsIFile *pRoot, nsIMutableArray *pArray) { return NS_ERROR_FAILURE;}
-
-  // Non-platform specific common stuff
-    // import a mailbox
-  nsresult ImportAddresses(uint32_t *pBytes, bool *pAbort, const char16_t *pName, nsIFile *pSrc, nsIAddrDatabase *pDb, nsString& errors);
-
-
-private:
-  void       EmptyAliases(void);
-  void      ProcessLine(const char *pLine, int32_t len, nsString& errors);
-  int32_t     CountWhiteSpace(const char *pLine, int32_t len);
-  CAliasEntry  *  ProcessAlias(const char *pLine, int32_t len, nsString& errors);
-  void      ProcessNote(const char *pLine, int32_t len, nsString& errors);
-  int32_t      GetAliasName(const char *pLine, int32_t len, nsCString& name);
-  CAliasEntry *  ResolveAlias(nsCString& name);
-  void       ResolveEntries(nsCString& name, nsTArray<CAliasData*>& list, nsTArray<CAliasData*>& result, bool addResolvedEntries, bool wasResolved, int32_t& numResolved);
-  void      BuildABCards(uint32_t *pBytes, nsIAddrDatabase *pDb);
-  void      AddSingleCard(CAliasEntry *pEntry, nsTArray<CAliasData*> &emailList, nsIAddrDatabase *pDb);
-  nsresult  AddSingleList(CAliasEntry *pEntry, nsTArray<CAliasData*> &emailList, nsIAddrDatabase *pDb);
-  nsresult  AddGroupMembersAsCards(nsTArray<CAliasData*> &membersArray, nsIAddrDatabase *pDb);
-  void      RememberGroupMembers(nsTArray<CAliasData*> &membersArray, nsTArray<CAliasData*> &emailList);
-  int32_t      FindAlias(nsCString& name);
-  void      ExtractNoteField(nsCString& note, nsCString& field, const char *pFieldName);
-  void FormatExtraDataInNoteField(int32_t labelStringID, nsCString& extraData, nsString& noteUTF16);
-  void      SanitizeValue(nsCString& val);
-  void      SplitString(nsCString& val1, nsCString& val2);
-
-public:
-  static int32_t     CountQuote(const char *pLine, int32_t len);
-  static int32_t     CountComment(const char *pLine, int32_t len);
-  static int32_t     CountAngle(const char *pLine, int32_t len);
-
-private:
-  nsTArray<CAliasEntry*>  m_alias;
-};
-
-
-
-#endif /* nsEudoraAddress_h__ */
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraCompose.cpp
+++ /dev/null
@@ -1,1088 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nscore.h"
-#include "prthread.h"
-#include "nsStringGlue.h"
-#include "nsMsgUtils.h"
-#include "nsUnicharUtils.h"
-#include "nsCOMPtr.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
-#include "nsIIOService.h"
-#include "nsIURI.h"
-#include "nsIOutputStream.h"
-#include "nsThreadUtils.h"
-
-#include "nsMsgBaseCID.h"
-#include "nsMsgCompCID.h"
-
-#include "nsIMsgCompose.h"
-#include "nsIMsgCompFields.h"
-#include "nsIMsgSend.h"
-#include "nsIMsgAccountManager.h"
-#include "nsMsgI18N.h"
-
-#include "nsNetCID.h"
-
-#include "nsEudoraCompose.h"
-#include "nsEudoraEditor.h"
-
-#include "EudoraDebugLog.h"
-
-#include "nsMimeTypes.h"
-#include "nsCRT.h"
-#include "nsNetUtil.h"
-#include "nsAutoPtr.h"
-#include "nsIMutableArray.h"
-
-static NS_DEFINE_CID(kMsgSendCID, NS_MSGSEND_CID);
-static NS_DEFINE_CID(kMsgCompFieldsCID, NS_MSGCOMPFIELDS_CID);
-
-// We need to do some calculations to set these numbers to something reasonable!
-// Unless of course, CreateAndSendMessage will NEVER EVER leave us in the lurch
-#define kHungCount 100000
-#define kHungAbortCount 1000
-
-// Define maximum possible length for content type sanity check
-#define kContentTypeLengthSanityCheck 32
-
-
-#ifdef IMPORT_DEBUG
-static char *p_test_headers =
-"Received: from netppl.invalid (IDENT:monitor@get.freebsd.because.microsoftsucks.invalid [209.3.31.115])\n\
- by mail4.sirius.invalid (8.9.1/8.9.1) with SMTP id PAA27232;\n\
- Mon, 17 May 1999 15:27:43 -0700 (PDT)\n\
-Message-ID: <ikGD3jRTsKklU.Ggm2HmE2A1Jsqd0p@netppl.invalid>\n\
-From: \"adsales@qualityservice.invalid\" <adsales@qualityservice.invalid>\n\
-Subject: Re: Your College Diploma (36822)\n\
-Date: Mon, 17 May 1999 15:09:29 -0400 (EDT)\n\
-MIME-Version: 1.0\n\
-Content-Type: TEXT/PLAIN; charset=\"US-ASCII\"\n\
-Content-Transfer-Encoding: 7bit\n\
-X-UIDL: 19990517.152941\n\
-Status: RO";
-
-static char *p_test_body =
-"Hello world?\n\
-";
-#else
-#define p_test_headers nullptr
-#define p_test_body nullptr
-#endif
-
-
-#define kWhitespace "\b\t\r\n "
-
-// The identity that we use in SendTheMessage is now a static. Previously the
-// identity was being created and destroyed for every Eudora message imported.
-// Now we create the identity when needed and keep it around until ReleaseIdentity
-// is called (after Eudora email importing is complete - currently called in
-// ~ImportEudoraMailImpl).
-//
-// This change was identified via profiling and has sped up importing email
-// from Eudora over 5x on my computer (test importing of my email went from
-// 6.5 hours to less than 1.2 hours). Importing from Eudora is still slow
-// in my opinion, but bearably slow now.
-nsIMsgIdentity * nsEudoraCompose::s_pIdentity = nullptr;
-
-
-// First off, a listener
-class EudoraSendListener : public nsIMsgSendListener
-{
-public:
-  EudoraSendListener() {
-    m_done = false;
-  }
-
-  // nsISupports interface
-  NS_DECL_THREADSAFE_ISUPPORTS
-
-  /* void OnStartSending (in string aMsgID, in uint32_t aMsgSize); */
-  NS_IMETHOD OnStartSending(const char *aMsgID, uint32_t aMsgSize) {return NS_OK;}
-
-  /* void OnProgress (in string aMsgID, in uint32_t aProgress, in uint32_t aProgressMax); */
-  NS_IMETHOD OnProgress(const char *aMsgID, uint32_t aProgress, uint32_t aProgressMax) {return NS_OK;}
-
-  /* void OnStatus (in string aMsgID, in wstring aMsg); */
-  NS_IMETHOD OnStatus(const char *aMsgID, const char16_t *aMsg) {return NS_OK;}
-
-  /* void OnStopSending (in string aMsgID, in nsresult aStatus, in wstring aMsg, in nsIFile returnFile); */
-  NS_IMETHOD OnStopSending(const char *aMsgID, nsresult aStatus, const char16_t *aMsg,
-               nsIFile *returnFile) {
-    m_done = true;
-    m_location = returnFile;
-    return NS_OK;
-  }
-
-    /* void OnSendNotPerformed */
-    NS_IMETHOD OnSendNotPerformed(const char *aMsgID, nsresult aStatus) {return NS_OK;}
-
-  /* void OnGetDraftFolderURI (); */
-  NS_IMETHOD OnGetDraftFolderURI(const char *aFolderURI) {return NS_OK;}
-
-  static nsresult CreateSendListener(nsIMsgSendListener **ppListener);
-
-  void Reset() { m_done = false;  m_location = nullptr;}
-
-public:
-  bool m_done;
-  nsCOMPtr <nsIFile> m_location;
-
-private:
-  virtual ~EudoraSendListener() {}
-};
-
-
-NS_IMPL_ISUPPORTS(EudoraSendListener, nsIMsgSendListener)
-
-nsresult EudoraSendListener::CreateSendListener(nsIMsgSendListener **ppListener)
-{
-  NS_ENSURE_ARG_POINTER(ppListener);
-  *ppListener = new EudoraSendListener();
-  NS_ENSURE_TRUE(*ppListener, NS_ERROR_OUT_OF_MEMORY);
-  NS_ADDREF(*ppListener);
-  return NS_OK;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////
-
-
-
-nsEudoraCompose::nsEudoraCompose()
-{
-  m_pAttachments = nullptr;
-  m_pListener = nullptr;
-  m_pMsgFields = nullptr;
-  m_pHeaders = p_test_headers;
-  if (m_pHeaders)
-    m_headerLen = strlen(m_pHeaders);
-  else
-    m_headerLen = 0;
-  m_pBody = p_test_body;
-  if (m_pBody)
-    m_bodyLen = strlen(m_pBody);
-  else
-    m_bodyLen = 0;
-
-  m_readHeaders.m_convertCRs = true;
-}
-
-
-nsEudoraCompose::~nsEudoraCompose()
-{
-  NS_IF_RELEASE(m_pListener);
-  NS_IF_RELEASE(m_pMsgFields);
-}
-
-nsresult nsEudoraCompose::CreateIdentity(void)
-{
-  if (s_pIdentity)
-    return NS_OK;
-
-  // Should only create identity from main thread
-  NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_FAILURE);
-  nsresult rv;
-  nsCOMPtr<nsIMsgAccountManager> accMgr(do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = accMgr->CreateIdentity(&s_pIdentity);
-  nsString name(NS_LITERAL_STRING("Import Identity"));
-  if (s_pIdentity) {
-    s_pIdentity->SetFullName(name);
-    s_pIdentity->SetIdentityName(name);
-    s_pIdentity->SetEmail(NS_LITERAL_CSTRING("import@import.service"));
-
-    // SetDoFcc to false to save time when CreateAndSendMessage operates.
-    // Profiling revealed that GetFolderURIFromUserPrefs was taking up a significant chunk
-    // of time during the operation of CreateAndSendMessage. By calling SetDoFcc(false),
-    // we skip Fcc handling code inside of InitCompositionFields (called indirectly during
-    // CreateAndSendMessage operation). There's no point in any Fcc code firing since the
-    // message will never actually be sent anyway.
-    s_pIdentity->SetDoFcc(false);
-  }
-  return rv;
-}
-
-void nsEudoraCompose::ReleaseIdentity(void)
-{
-  if (s_pIdentity) {
-    nsresult rv = s_pIdentity->ClearAllValues();
-    NS_ASSERTION(NS_SUCCEEDED(rv),"failed to clear values");
-    if (NS_FAILED(rv)) return;
-
-    NS_RELEASE(s_pIdentity);
-  }
-}
-
-
-nsresult nsEudoraCompose::CreateComponents(void)
-{
-  nsresult  rv = NS_OK;
-
-  if (!m_pIOService) {
-    IMPORT_LOG0("Creating nsIOService\n");
-    
-    m_pIOService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  NS_IF_RELEASE(m_pMsgFields);
-  if (!m_pListener && NS_SUCCEEDED(rv))
-    rv = EudoraSendListener::CreateSendListener(&m_pListener);
-
-  if (NS_SUCCEEDED(rv)) {
-      rv = CallCreateInstance(kMsgCompFieldsCID, &m_pMsgFields);
-    if (NS_SUCCEEDED(rv) && m_pMsgFields) {
-      // IMPORT_LOG0("nsOutlookCompose - CreateComponents succeeded\n");
-      m_pMsgFields->SetForcePlainText(false);
-      return NS_OK;
-    }
-  }
-
-  return NS_ERROR_FAILURE;
-}
-
-void nsEudoraCompose::GetNthHeader(const char *pData,
-                                   int32_t dataLen,
-                                   int32_t n,
-                                   nsCString& header,
-                                   nsCString& val,
-                                   bool unwrap)
-{
-  header.Truncate();
-  val.Truncate();
-  if (!pData)
-    return;
-
-  int32_t index = 0;
-  int32_t len;
-  int32_t start = 0;
-  const char *pChar = pData;
-  const char *pStart;
-  if (n == 0) {
-    pStart = pChar;
-    len = 0;
-    while ((start < dataLen) && (*pChar != ':')) {
-      start++;
-      len++;
-      pChar++;
-    }
-    header.Append(pStart, len);
-    header.Trim(kWhitespace);
-    start++;
-    pChar++;
-  }
-  else {
-    while (start < dataLen) {
-      if ((*pChar != ' ') && (*pChar != '\t')) {
-        if (n == index) {
-          pStart = pChar;
-          len = 0;
-          while ((start < dataLen) && (*pChar != ':')) {
-            start++;
-            len++;
-            pChar++;
-          }
-          header.Append(pStart, len);
-          header.Trim(kWhitespace);
-          start++;
-          pChar++;
-          break;
-        }
-        else
-          index++;
-      }
-
-      // Skip to next end of line.
-      while ((start < dataLen) &&
-             (*pChar != nsCRT::CR) && (*pChar != nsCRT::LF)) {
-        start++;
-        pChar++;
-      }
-      // Skip over end of line(s).
-      while ((start < dataLen) &&
-             ((*pChar == nsCRT::CR) || (*pChar == nsCRT::LF))) {
-        start++;
-        pChar++;
-      }
-    }
-  }
-
-  if (start >= dataLen)
-    return;
-
-  int32_t lineEnd;
-  int32_t end = start;
-  while (end < dataLen) {
-    // Skip to next end of line.
-    while ((end < dataLen) && (*pChar != nsCRT::CR) && (*pChar != nsCRT::LF)) {
-      end++;
-      pChar++;
-    }
-
-    if (end > start) {
-      val.Append(pData + start, end - start);
-    }
-
-    lineEnd = end;
-    pStart = pChar;
-
-    // Skip over end of line(s).
-    while ((end < dataLen) &&
-           ((*pChar == nsCRT::CR) || (*pChar == nsCRT::LF))) {
-      end++;
-      pChar++;
-    }
-
-    start = end;
-
-    // Skip over space(s) and tab(s).
-    while ((end < dataLen) && ((*pChar == ' ') || (*pChar == '\t'))) {
-      end++;
-      pChar++;
-    }
-
-    if (start == end)
-      break;
-
-    if (unwrap)
-      val.Append(' ');
-    else {
-      val.Append(pStart, end - lineEnd);
-    }
-
-    start = end;
-  }
-
-  val.Trim(kWhitespace);
-}
-
-
-void nsEudoraCompose::GetHeaderValue(const char *pData,
-                                     int32_t dataLen,
-                                     const char *pHeader,
-                                     nsCString& val,
-                                     bool unwrap)
-{
-  val.Truncate();
-  if (!pData)
-    return;
-
-  int32_t  start = 0;
-  int32_t len = strlen(pHeader);
-  const char *pChar = pData;
-  if (!PL_strncasecmp(pHeader, pData, len)) {
-    start = len;
-  }
-  else {
-    while (start < dataLen) {
-      // Skip to next end of line.
-      while ((start < dataLen) &&
-             (*pChar != nsCRT::CR) && (*pChar != nsCRT::LF)) {
-        start++;
-        pChar++;
-      }
-      // Skip over end of line(s).
-      while ((start < dataLen) &&
-             ((*pChar == nsCRT::CR) || (*pChar == nsCRT::LF))) {
-        start++;
-        pChar++;
-      }
-
-      if ((start < dataLen) && !PL_strncasecmp(pChar, pHeader, len))
-        break;
-    }
-    if (start < dataLen)
-      start += len;
-  }
-
-  if (start >= dataLen)
-    return;
-
-  int32_t end = start;
-  int32_t lineEnd;
-  const char * pStart;
-
-  pChar = pData + start;
-
-  while (end < dataLen) {
-    // Skip to next end of line.
-    while ((end < dataLen) && (*pChar != nsCRT::CR) && (*pChar != nsCRT::LF)) {
-      end++;
-      pChar++;
-    }
-
-    if (end > start)
-      val.Append(pData + start, end - start);
-
-    lineEnd = end;
-    pStart = pChar;
-
-    // Skip over the end of line(s).
-    while ((end < dataLen) &&
-           ((*pChar == nsCRT::CR) || (*pChar == nsCRT::LF))) {
-      end++;
-      pChar++;
-    }
-
-    start = end;
-
-    // Skip over space(s) and tab(s).
-    while ((end < dataLen) && ((*pChar == ' ') || (*pChar == '\t'))) {
-      end++;
-      pChar++;
-    }
-
-    if (start == end)
-      break;
-
-    if (unwrap)
-      val.Append(' ');
-    else {
-      val.Append(pStart, end - lineEnd);
-    }
-
-    start = end;
-  }
-
-  val.Trim(kWhitespace);
-}
-
-
-void nsEudoraCompose::ExtractCharset(nsString& str)
-{
-  int32_t idx = MsgFind(str, "charset=", true, 0);
-  if (idx != -1) {
-    str.Cut(0, idx + 8);
-    idx = str.FindChar(';');
-    if (idx != -1)
-      str.SetLength(idx);
-    str.Trim(kWhitespace);
-    if ((str.CharAt(0) == '"') && (str.Length() > 2)) {
-      str.SetLength(str.Length() - 1);
-      str.Cut(0, 1);
-      str.Trim(kWhitespace);
-    }
-  }
-  else
-    str.Truncate();
-}
-
-void nsEudoraCompose::ExtractType(nsString& str)
-{
-  nsString tStr;
-  int32_t idx = str.FindChar(';');
-  if (idx != -1)
-    str.SetLength(idx);
-
-  str.Trim(kWhitespace);
-
-  if ((str.CharAt(0) == '"') && (str.Length() > 2)) {
-    str.SetLength(str.Length() - 1);
-    str.Cut(0, 1);
-    str.Trim(kWhitespace);
-  }
-
-  // if multipart then ignore it since no outlook message body is ever
-  // valid multipart!
-  if (StringBeginsWith(str, NS_LITERAL_STRING("multipart/"), nsCaseInsensitiveStringComparator()))
-    str.Truncate();
-}
-
-nsresult nsEudoraCompose::GetLocalAttachments(nsIArray **aArray)
-{
-  /*
-  nsIURI      *url = nullptr;
-  */
-  nsresult rv;
-  nsCOMPtr<nsIMutableArray> attachments (do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
-  NS_ENSURE_SUCCESS(rv, rv);
-  NS_IF_ADDREF(*aArray = attachments);
-  int32_t count = 0;
-  if (m_pAttachments)
-    count = m_pAttachments->Length();
-  if (!count)
-    return NS_OK;
-
-  nsCString urlStr;
-  ImportAttachment * pAttach;
-
-  for (int32_t i = 0; i < count; i++) {
-    nsCOMPtr<nsIMsgAttachedFile> a(do_CreateInstance(NS_MSGATTACHEDFILE_CONTRACTID, &rv));
-    NS_ENSURE_SUCCESS(rv, rv);
-    // nsMsgNewURL(&url, "file://C:/boxster.jpg");
-    // a[i].orig_url = url;
-
-    pAttach = m_pAttachments->ElementAt(i);
-    nsCOMPtr<nsIFile> tmpFile = do_QueryInterface(pAttach->pAttachment);
-    a->SetTmpFile(tmpFile);
-    urlStr.Adopt(0);
-
-    nsCOMPtr <nsIURI> uri;
-    nsresult rv = NS_NewFileURI(getter_AddRefs(uri), pAttach->pAttachment);
-    NS_ENSURE_SUCCESS(rv, rv);
-    uri->GetSpec(urlStr);
-    if (urlStr.IsEmpty())
-      return NS_ERROR_FAILURE;
-
-    nsCOMPtr<nsIURI> origUrl;
-    rv = m_pIOService->NewURI(urlStr, nullptr, nullptr, getter_AddRefs(origUrl));
-    NS_ENSURE_SUCCESS(rv, rv);
-    a->SetOrigUrl(origUrl);
-    a->SetType(nsDependentCString(pAttach->mimeType));
-    a->SetRealName(nsDependentCString(pAttach->description));
-    a->SetEncoding(NS_LITERAL_CSTRING(ENCODING_BINARY));
-    attachments->AppendElement(a, false);
-  }
-  return NS_OK;
-}
-
-// Test a message send????
-nsresult nsEudoraCompose::SendTheMessage(nsIFile *pMailImportLocation, nsIFile **pMsg)
-{
-  nsresult rv = CreateComponents();
-  if (NS_FAILED(rv))
-    return rv;
-
-  // IMPORT_LOG0("Outlook Compose created necessary components\n");
-
-  nsString bodyType;
-  nsString charSet;
-  nsString headerVal;
-  GetHeaderValue(m_pHeaders, m_headerLen, "From:", headerVal);
-  if (!headerVal.IsEmpty())
-    m_pMsgFields->SetFrom(headerVal);
-  GetHeaderValue(m_pHeaders, m_headerLen, "To:", headerVal);
-  if (!headerVal.IsEmpty())
-    m_pMsgFields->SetTo(headerVal);
-  GetHeaderValue(m_pHeaders, m_headerLen, "Subject:", headerVal);
-  if (!headerVal.IsEmpty())
-    m_pMsgFields->SetSubject(headerVal);
-  GetHeaderValue(m_pHeaders, m_headerLen, "Content-type:", headerVal);
-  bodyType = headerVal;
-  ExtractType(bodyType);
-  ExtractCharset(headerVal);
-  // Use platform charset as default if the msg doesn't specify one
-  // (ie, no 'charset' param in the Content-Type: header). As the last
-  // resort we'll use the mail default charset.
-  // (ie, no 'charset' param in the Content-Type: header) or if the
-  // charset parameter fails a length sanity check.
-  // As the last resort we'll use the mail default charset.
-  if (headerVal.IsEmpty() || (headerVal.Length() > kContentTypeLengthSanityCheck))
-  {
-    headerVal.AssignASCII(nsMsgI18NFileSystemCharset());
-    if (headerVal.IsEmpty())
-    { // last resort
-      if (m_defCharset.IsEmpty())
-      {
-        nsString defaultCharset;
-        NS_GetLocalizedUnicharPreferenceWithDefault(nullptr, "mailnews.view_default_charset",
-                                                    NS_LITERAL_STRING("ISO-8859-1"), defaultCharset);
-        m_defCharset = defaultCharset;
-      }
-      headerVal = m_defCharset;
-    }
-  }
-  m_pMsgFields->SetCharacterSet(NS_LossyConvertUTF16toASCII(headerVal).get());
-  charSet = headerVal;
-  GetHeaderValue(m_pHeaders, m_headerLen, "CC:", headerVal);
-  if (!headerVal.IsEmpty())
-    m_pMsgFields->SetCc(headerVal);
-  GetHeaderValue(m_pHeaders, m_headerLen, "Message-ID:", headerVal);
-  if (!headerVal.IsEmpty())
-    m_pMsgFields->SetMessageId(NS_LossyConvertUTF16toASCII(headerVal).get());
-  GetHeaderValue(m_pHeaders, m_headerLen, "Reply-To:", headerVal);
-  if (!headerVal.IsEmpty())
-    m_pMsgFields->SetReplyTo(headerVal);
-
-  // what about all of the other headers?!?!?!?!?!?!
-  char *pMimeType;
-  if (!bodyType.IsEmpty())
-    pMimeType = ToNewCString(NS_LossyConvertUTF16toASCII(bodyType));
-  else
-    pMimeType = ToNewCString(m_bodyType);
-
-  nsCOMPtr<nsIArray> pAttach;
-  GetLocalAttachments(getter_AddRefs(pAttach));
-  nsEudoraEditor eudoraEditor(m_pBody, pMailImportLocation);
-  nsCOMPtr<nsIArray> embeddedObjects;
-  if (eudoraEditor.HasEmbeddedContent())
-    eudoraEditor.GetEmbeddedObjects(getter_AddRefs(embeddedObjects));
-
-  nsString uniBody;
-  NS_CopyNativeToUnicode(nsDependentCString(m_pBody), uniBody);
-
-  /*
-    l10n - I have the body of the message in the system charset,
-    I need to "encode" it to be the charset for the message
-    *UNLESS* of course, I don't know what the charset of the message
-    should be?  How do I determine what the charset should
-    be if it doesn't exist?
-
-  */
-
-  nsCString body;
-
-  rv = nsMsgI18NConvertFromUnicode(NS_LossyConvertUTF16toASCII(charSet).get(),
-                                    uniBody, body);
-  if (NS_FAILED(rv) && !charSet.Equals(m_defCharset)) {
-    // in this case, if we did not use the default compose
-    // charset, then try that.
-    body.Truncate();
-    rv = nsMsgI18NConvertFromUnicode(NS_LossyConvertUTF16toASCII(charSet).get(),
-                                     uniBody, body);
-  }
-  uniBody.Truncate();
-
-
-  // See if it's a draft msg (ie, no From: or no To: AND no Cc: AND no Bcc:).
-  // Eudora saves sent and draft msgs in Out folder (ie, mixed) and it does
-  // store Bcc: header in the msg itself.
-  nsAutoString from, to, cc, bcc;
-  rv = m_pMsgFields->GetFrom(from);
-  rv = m_pMsgFields->GetTo(to);
-  rv = m_pMsgFields->GetCc(cc);
-  rv = m_pMsgFields->GetBcc(bcc);
-  bool createAsDraft = from.IsEmpty() || (to.IsEmpty() && cc.IsEmpty() && bcc.IsEmpty());
-
-  nsCOMPtr<nsIImportService> impService(do_GetService(NS_IMPORTSERVICE_CONTRACTID, &rv));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = impService->CreateRFC822Message(
-                        s_pIdentity,                  // dummy identity
-                        m_pMsgFields,                 // message fields
-                        pMimeType,                    // body type
-                        body,                         // body pointer
-                        createAsDraft,
-                        pAttach,                      // local attachments
-                        embeddedObjects,
-                        m_pListener);                 // listener
-
-  EudoraSendListener *pListen = (EudoraSendListener *)m_pListener;
-  if (NS_FAILED(rv)) {
-    IMPORT_LOG1("*** Error, CreateAndSendMessage FAILED: 0x%lx\n", rv);
-    // IMPORT_LOG1("Headers: %80s\n", m_pHeaders);
-  }
-  else {
-    // wait for the listener to get done!
-    int32_t abortCnt = 0;
-    int32_t cnt = 0;
-    int32_t sleepCnt = 1;
-    while (!pListen->m_done && (abortCnt < kHungAbortCount)) {
-      PR_Sleep(sleepCnt);
-      cnt++;
-      if (cnt > kHungCount) {
-        abortCnt++;
-        sleepCnt *= 2;
-        cnt = 0;
-      }
-    }
-
-    if (abortCnt >= kHungAbortCount) {
-      IMPORT_LOG0("**** Create and send message hung\n");
-      IMPORT_LOG1("Headers: %s\n", m_pHeaders);
-      IMPORT_LOG1("Body: %s\n", m_pBody);
-      rv = NS_ERROR_FAILURE;
-    }
-
-  }
-
-  if (pMimeType)
-    NS_Free(pMimeType);
-
-  if (pListen->m_location) {
-    pListen->m_location->Clone(pMsg);
-    rv = NS_OK;
-  }
-  else {
-    rv = NS_ERROR_FAILURE;
-    IMPORT_LOG0("*** Error, Outlook compose unsuccessful\n");
-  }
-
-  pListen->Reset();
-
-  return rv;
-}
-
-
-bool SimpleBufferTonyRCopiedOnce::SpecialMemCpy(int32_t offset, const char *pData, int32_t len, int32_t *pWritten)
-{
-  // Arg!!!!!  Mozilla can't handle plain CRs in any mail messages.  Particularly a
-  // problem with Eudora since it doesn't give a rats a**
-  *pWritten = len;
-  int32_t  sz = offset + len;
-  if (offset) {
-    if ((m_pBuffer[offset - 1] == nsCRT::CR) && (*pData != nsCRT::LF)) {
-      sz++;
-      if (!Grow(sz))
-        return false;
-      m_pBuffer[offset] = nsCRT::LF;
-      offset++;
-      (*pWritten)++;
-    }
-  }
-  while (len > 0) {
-    if ((*pData == nsCRT::CR) && (*(pData + 1) != nsCRT::LF)) {
-      sz++;
-      if (!Grow(sz))
-        return false;
-      m_pBuffer[offset] = nsCRT::CR;
-      offset++;
-      m_pBuffer[offset] = nsCRT::LF;
-      (*pWritten)++;
-    }
-    else {
-      m_pBuffer[offset] = *pData;
-    }
-    offset++;
-    pData++;
-    len--;
-  }
-
-  return true;
-}
-
-nsresult nsEudoraCompose::ReadHeaders(ReadFileState *pState, SimpleBufferTonyRCopiedOnce& copy, SimpleBufferTonyRCopiedOnce& header)
-{
-  // This should be the headers...
-  header.m_writeOffset = 0;
-
-  nsresult rv;
-  int32_t lineLen;
-  int32_t endLen = -1;
-  int8_t endBuffer = 0;
-
-  while ((endLen = IsEndHeaders(copy)) == -1) {
-    while ((lineLen = FindNextEndLine(copy)) == -1) {
-      copy.m_writeOffset = copy.m_bytesInBuf;
-      if (!header.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-        IMPORT_LOG0("*** ERROR, writing headers\n");
-        return NS_ERROR_FAILURE;
-      }
-      if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-        IMPORT_LOG0("*** Error reading message headers\n");
-        return rv;
-      }
-      if (!copy.m_bytesInBuf) {
-        IMPORT_LOG0("*** Error, end of file while reading headers\n");
-        return NS_ERROR_FAILURE;
-      }
-    }
-    copy.m_writeOffset += lineLen;
-    if ((copy.m_writeOffset + 4) >= copy.m_bytesInBuf) {
-      if (!header.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-        IMPORT_LOG0("*** ERROR, writing headers 2\n");
-        return NS_ERROR_FAILURE;
-      }
-      if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-        IMPORT_LOG0("*** Error reading message headers 2\n");
-        return rv;
-      }
-    }
-  }
-
-  if (!header.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-    IMPORT_LOG0("*** Error writing final headers\n");
-    return NS_ERROR_FAILURE;
-  }
-  if (!header.Write((const char *)&endBuffer, 1)) {
-    IMPORT_LOG0("*** Error writing header trailing null\n");
-    return NS_ERROR_FAILURE;
-  }
-
-  copy.m_writeOffset += endLen;
-
-  return NS_OK;
-}
-
-int32_t nsEudoraCompose::FindNextEndLine(SimpleBufferTonyRCopiedOnce& data)
-{
-  int32_t len = data.m_bytesInBuf - data.m_writeOffset;
-  if (!len)
-    return -1;
-
-  int32_t count = 0;
-  const char *pData = data.m_pBuffer + data.m_writeOffset;
-  // Skip over end of line(s).
-  while ((count < len) && ((*pData == nsCRT::CR) || (*pData == nsCRT::LF))) {
-    pData++;
-    count++;
-  }
-  // Skip to next end of line.
-  while ((count < len) && (*pData != nsCRT::CR) && (*pData != nsCRT::LF)) {
-    pData++;
-    count++;
-  }
-
-  return (count < len) ? count : -1;
-}
-
-int32_t nsEudoraCompose::IsEndHeaders(SimpleBufferTonyRCopiedOnce& data)
-{
-  int32_t len = data.m_bytesInBuf - data.m_writeOffset;
-  if (len < 2)
-    return -1;
-
-  const char *pChar = data.m_pBuffer + data.m_writeOffset;
-  // Double nsCRT::CR.
-  if ((*pChar == nsCRT::CR) && (*(pChar + 1) == nsCRT::CR))
-    return 2;
-
-  if (len < 4)
-    return -1;
-
-  // Double (nsCRT::CR + nsCRT::LF).
-  if ((*pChar == nsCRT::CR) && (*(pChar + 1) == nsCRT::LF) &&
-      (*(pChar + 2) == nsCRT::CR) && (*(pChar + 3) == nsCRT::LF))
-    return 4;
-
-  return -1;
-}
-
-
-nsresult nsEudoraCompose::CopyComposedMessage(nsCString& fromLine,
-                                              nsIFile *pSrc,
-                                              nsIOutputStream *pDst,
-                                              SimpleBufferTonyRCopiedOnce& copy)
-{
-  copy.m_bytesInBuf = 0;
-  copy.m_writeOffset = 0;
-  ReadFileState  state;
-  state.pFile = pSrc;
-  state.offset = 0;
-  state.size = 0;
-
-  pSrc->GetFileSize(&state.size);
-  if (!state.size) {
-    IMPORT_LOG0("*** Error, unexpected zero file size for composed message\n");
-    return NS_ERROR_FAILURE;
-  }
-
-        nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(state.pInputStream), pSrc);
-
-  if (NS_FAILED(rv)) {
-    IMPORT_LOG0("*** Error, unable to open composed message file\n");
-    return NS_ERROR_FAILURE;
-  }
-
-  uint32_t written;
-  rv = pDst->Write(fromLine.get(), fromLine.Length(), &written);
-
-  // well, isn't this a hoot!
-  // Read the headers from the new message, get the ones we like
-  // and write out only the headers we want from the new message,
-  // along with all of the other headers from the "old" message!
-  if (NS_SUCCEEDED(rv))
-    rv = FillMailBuffer(&state, copy);
-  if (NS_SUCCEEDED(rv))
-    rv = ReadHeaders(&state, copy, m_readHeaders);
-
-  if (NS_SUCCEEDED(rv))
-    rv = WriteHeaders(pDst, m_readHeaders);
-
-  // We need to go ahead and write out the rest of the copy buffer
-  // so that the following will properly copy the rest of the body
-  char lastChar = 0;
-
-  rv = EscapeFromSpaceLine(pDst, copy.m_pBuffer + copy.m_writeOffset, copy.m_pBuffer+copy.m_bytesInBuf);
-  if (copy.m_bytesInBuf)
-    lastChar = copy.m_pBuffer[copy.m_bytesInBuf - 1];
-  if (NS_SUCCEEDED(rv))
-    copy.m_writeOffset = copy.m_bytesInBuf;
-
-  while ((state.offset < state.size) && NS_SUCCEEDED(rv)) {
-    rv = FillMailBuffer(&state, copy);
-    if (NS_SUCCEEDED(rv)) {
-      rv = EscapeFromSpaceLine(pDst, copy.m_pBuffer + copy.m_writeOffset, copy.m_pBuffer+copy.m_bytesInBuf);
-      lastChar = copy.m_pBuffer[copy.m_bytesInBuf - 1];
-      if (NS_SUCCEEDED(rv))
-        copy.m_writeOffset = copy.m_bytesInBuf;
-      else
-        IMPORT_LOG0("*** Error writing to destination mailbox\n");
-    }
-  }
-
-  state.pInputStream->Close();
-
-  if ((lastChar != nsCRT::LF) && NS_SUCCEEDED(rv)) {
-    rv = pDst->Write("\x0D\x0A", 2, &written);
-    if (written != 2)
-      rv = NS_ERROR_FAILURE;
-  }
-
-  return rv;
-}
-
-nsresult nsEudoraCompose::FillMailBuffer(ReadFileState *pState, SimpleBufferTonyRCopiedOnce& read)
-{
-  if (read.m_writeOffset >= read.m_bytesInBuf) {
-    read.m_writeOffset = 0;
-    read.m_bytesInBuf = 0;
-  }
-  else if (read.m_writeOffset) {
-    memcpy(read.m_pBuffer, read.m_pBuffer + read.m_writeOffset, read.m_bytesInBuf - read.m_writeOffset);
-    read.m_bytesInBuf -= read.m_writeOffset;
-    read.m_writeOffset = 0;
-  }
-
-  uint32_t count = read.m_size - read.m_bytesInBuf;
-  if ((count + pState->offset) > pState->size)
-    count = pState->size - pState->offset;
-  if (count) {
-    uint32_t bytesRead = 0;
-    char * pBuffer = read.m_pBuffer + read.m_bytesInBuf;
-    nsresult rv = pState->pInputStream->Read(pBuffer, count, &bytesRead);
-    if (NS_FAILED(rv))
-      return rv;
-    if (bytesRead != count)
-      return NS_ERROR_FAILURE;
-    read.m_bytesInBuf += bytesRead;
-    pState->offset += bytesRead;
-  }
-
-  return NS_OK;
-}
-
-
-#define kMaxSpecialHeaders 3
-static const char *gSpecialHeaders[kMaxSpecialHeaders] = {
-  "Content-type",
-  "MIME-Version",
-  "Content-transfer-encoding"
-};
-// consider "X-Accept-Language"?
-
-#define kMaxReplaceHeaders 5
-static const char *gReplaceHeaders[kMaxReplaceHeaders] = {
-  "From",
-  "To",
-  "Subject",
-  "Reply-to",
-  "cc"
-};
-
-bool nsEudoraCompose::IsReplaceHeader(const char *pHeader)
-{
-  for (int i = 0; i < kMaxReplaceHeaders; i++) {
-    if (!PL_strcasecmp(pHeader, gReplaceHeaders[i]))
-      return true;
-  }
-
-  return false;
-}
-
-int32_t nsEudoraCompose::IsSpecialHeader(const char *pHeader)
-{
-  for (int i = 0; i < kMaxSpecialHeaders; i++) {
-    if (!PL_strcasecmp(pHeader, gSpecialHeaders[i]))
-      return (int32_t) i;
-  }
-
-  return -1;
-}
-
-
-nsresult nsEudoraCompose::WriteHeaders(nsIOutputStream *pDst, SimpleBufferTonyRCopiedOnce& newHeaders)
-{
-  // Well, ain't this a peach?
-  // This is rather disgusting but there really isn't much to be done about it....
-
-  // 1. For each "old" header, replace it with the new one if we want,
-  // then right it out.
-  // 2. Then if we haven't written the "important" new headers, write them out
-  // 3. Terminate the headers with an extra eol.
-
-  int32_t n = 0;
-  nsCString header;
-  nsCString val;
-  nsCString replaceVal;
-  uint32_t written;
-  nsresult rv = NS_OK; // it's ok if we don't have the first header on the predefined lists.
-  int32_t specialHeader;
-  bool specials[kMaxSpecialHeaders];
-  bool      hasDateHeader = false;
-  int i;
-
-  for (i = 0; i < kMaxSpecialHeaders; i++)
-    specials[i] = false;
-
-  // m_pHeaders - contains headers from a Eudora msg.
-  // newHeaders - contains headers from a mozilla msg (more headers here).
-  do {
-    GetNthHeader(m_pHeaders, m_headerLen, n, header, val, false);
-    // GetNthHeader(newHeaders.m_pBuffer, newHeaders.m_writeOffset, n, header, val, false);
-    if (!header.IsEmpty()) {
-      if ((specialHeader = IsSpecialHeader(header.get())) != -1) {
-        header.Append(':');
-        GetHeaderValue(newHeaders.m_pBuffer, newHeaders.m_writeOffset - 1,
-                       header.get(), val, false);
-        header.SetLength(header.Length() - 1);
-        specials[specialHeader] = true;
-      }
-      else if (IsReplaceHeader(header.get())) {
-        replaceVal.Truncate();
-        header.Append(':');
-        GetHeaderValue(newHeaders.m_pBuffer, newHeaders.m_writeOffset - 1,
-                       header.get(), replaceVal, false);
-        header.SetLength(header.Length() - 1);
-        if (!replaceVal.IsEmpty())
-          val = replaceVal;
-      }
-      if (!val.IsEmpty()) {
-        // See if we're writing out a Date: header.
-        if (header.LowerCaseEqualsLiteral("date"))
-          hasDateHeader = true;
-        rv = pDst->Write(header.get(), header.Length(), &written);
-        if (NS_SUCCEEDED(rv))
-          rv = pDst->Write(": ", 2, &written);
-        if (NS_SUCCEEDED(rv))
-          rv = pDst->Write(val.get(), val.Length(), &written);
-        if (NS_SUCCEEDED(rv))
-          rv = pDst->Write("\x0D\x0A", 2, &written);
-
-      }
-    }
-    n++;
-  } while (NS_SUCCEEDED(rv) && !header.IsEmpty());
-
-  // If we don't have Date: header so far then use the default one (taken from Eudora "From " line).
-  if (!hasDateHeader)
-  {
-    rv = pDst->Write(m_defaultDate.get(), m_defaultDate.Length(), &written);
-    if (NS_SUCCEEDED(rv))
-      rv = pDst->Write("\x0D\x0A", 2, &written);
-  }
-
-  for (i = 0; (i < kMaxSpecialHeaders) && NS_SUCCEEDED(rv); i++) {
-    if (!specials[i]) {
-      header = gSpecialHeaders[i];
-      header.Append(':');
-      GetHeaderValue(newHeaders.m_pBuffer, newHeaders.m_writeOffset - 1,
-                     header.get(), val, false);
-      header.SetLength(header.Length() - 1);
-      if (!val.IsEmpty()) {
-        rv = pDst->Write(header.get(), header.Length(), &written);
-        if (NS_SUCCEEDED(rv))
-          rv = pDst->Write(": ", 2, &written);
-        if (NS_SUCCEEDED(rv))
-          rv = pDst->Write(val.get(), val.Length(), &written);
-        if (NS_SUCCEEDED(rv))
-          rv = pDst->Write("\x0D\x0A", 2, &written);
-      }
-    }
-  }
-
-  if (NS_SUCCEEDED(rv))
-    rv = pDst->Write("\x0D\x0A", 2, &written);
-  return rv;
-}
-
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraCompose.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsEudoraCompose_h__
-#define nsEudoraCompose_h__
-
-#include "nscore.h"
-#include "nsCOMPtr.h"
-#include "nsStringGlue.h"
-#include "nsMsgUtils.h"
-#include "nsIFile.h"
-#include "nsIInputStream.h"
-#include "nsTArray.h"
-#include "nsIImportService.h"
-
-#ifdef MOZILLA_INTERNAL_API
-#include "nsNativeCharsetUtils.h"
-#else
-#include "nsMsgI18N.h"
-#define NS_CopyNativeToUnicode(source, dest) \
-        nsMsgI18NConvertToUnicode(nsMsgI18NFileSystemCharset(), source, dest)
-#endif
-
-class nsIMsgSend;
-class nsIMsgCompFields;
-class nsIMsgIdentity;
-class nsIMsgSendListener;
-class nsIIOService;
-
-#include "nsIMsgSend.h"
-
-
-typedef class {
-public:
-  nsCOMPtr <nsIFile>  pAttachment;
-  char *      mimeType;
-  char *      description;
-} ImportAttachment;
-
-typedef class {
-public:
-  uint32_t    offset;
-  int64_t    size;
-  nsCOMPtr <nsIFile>  pFile;
-        nsCOMPtr <nsIInputStream> pInputStream;
-} ReadFileState;
-
-class SimpleBufferTonyRCopiedOnce {
-public:
-  SimpleBufferTonyRCopiedOnce() {m_pBuffer = nullptr; m_size = 0; m_growBy = 4096; m_writeOffset = 0;
-          m_bytesInBuf = 0; m_convertCRs = false;}
-  ~SimpleBufferTonyRCopiedOnce() { if (m_pBuffer) delete [] m_pBuffer;}
-
-  bool Allocate(int32_t sz) {
-    if (m_pBuffer)
-      delete [] m_pBuffer;
-    m_pBuffer = new char[sz];
-    if (m_pBuffer) {
-      m_size = sz;
-      return true;
-    }
-    m_size = 0;
-    return false;
-  }
-
-  bool Grow(int32_t newSize) { if (newSize > m_size) return ReAllocate(newSize); else return true;}
-  bool ReAllocate(int32_t newSize) {
-    if (newSize <= m_size) return true;
-    char *pOldBuffer = m_pBuffer;
-    int32_t  oldSize = m_size;
-    m_pBuffer = nullptr;
-    while (m_size < newSize) m_size += m_growBy;
-    if (Allocate(m_size)) {
-      if (pOldBuffer) { memcpy(m_pBuffer, pOldBuffer, oldSize); delete [] pOldBuffer;}
-      return true;
-    }
-    else { m_pBuffer = pOldBuffer; m_size = oldSize; return false;}
-  }
-
-  bool Write(int32_t offset, const char *pData, int32_t len, int32_t *pWritten) {
-    *pWritten = len;
-    if (!len) return true;
-    if (!Grow(offset + len)) return false;
-    if (m_convertCRs)
-      return SpecialMemCpy(offset, pData, len, pWritten);
-    memcpy(m_pBuffer + offset, pData, len);
-    return true;
-  }
-
-  bool Write(const char *pData, int32_t len) {
-    int32_t written;
-    if (Write(m_writeOffset, pData, len, &written)) { m_writeOffset += written; return true;}
-    else return false;
-  }
-
-  bool    SpecialMemCpy(int32_t offset, const char *pData, int32_t len, int32_t *pWritten);
-
-  bool    m_convertCRs;
-  char *  m_pBuffer;
-  uint32_t  m_bytesInBuf;  // used when reading into this buffer
-  int32_t  m_size;      // allocated size of buffer
-  int32_t  m_growBy;    // duh
-  uint32_t m_writeOffset;  // used when writing into and reading from the buffer
-};
-
-
-
-class nsEudoraCompose {
-public:
-  nsEudoraCompose();
-  ~nsEudoraCompose();
-
-  nsresult  SendTheMessage(nsIFile *pMailImportLocation, nsIFile **pMsg);
-
-  void    SetBody(const char *pBody, int32_t len, nsCString &bodyType) { m_pBody = pBody; m_bodyLen = len; m_bodyType = bodyType;}
-  void    SetHeaders(const char *pHeaders, int32_t len) { m_pHeaders = pHeaders; m_headerLen = len;}
-  void    SetAttachments(nsTArray<ImportAttachment*> *pAttachments) { m_pAttachments = pAttachments;}
-  void    SetDefaultDate(nsCString date) { m_defaultDate = date;}
-
-  nsresult  CopyComposedMessage(nsCString& fromLine, nsIFile *pSrc, nsIOutputStream *pDst, SimpleBufferTonyRCopiedOnce& copy);
-
-  static nsresult  FillMailBuffer(ReadFileState *pState, SimpleBufferTonyRCopiedOnce& read);
-  static nsresult CreateIdentity(void);
-  static void    ReleaseIdentity(void);
-
-private:
-  nsresult  CreateComponents(void);
-
-  void    GetNthHeader(const char *pData, int32_t dataLen, int32_t n, nsCString& header, nsCString& val, bool unwrap);
-  void    GetHeaderValue(const char *pData, int32_t dataLen, const char *pHeader, nsCString& val, bool unwrap = true);
-  void    GetHeaderValue(const char *pData, int32_t dataLen, const char *pHeader, nsString& val) {
-    val.Truncate();
-    nsCString  hVal;
-    GetHeaderValue(pData, dataLen, pHeader, hVal, true);
-    NS_CopyNativeToUnicode(hVal, val);
-  }
-  void    ExtractCharset(nsString& str);
-  void    ExtractType(nsString& str);
-
-  nsresult GetLocalAttachments(nsIArray **aArray);
-
-  nsresult  ReadHeaders(ReadFileState *pState, SimpleBufferTonyRCopiedOnce& copy, SimpleBufferTonyRCopiedOnce& header);
-  int32_t    FindNextEndLine(SimpleBufferTonyRCopiedOnce& data);
-  int32_t    IsEndHeaders(SimpleBufferTonyRCopiedOnce& data);
-  int32_t    IsSpecialHeader(const char *pHeader);
-  nsresult  WriteHeaders(nsIOutputStream *pDst, SimpleBufferTonyRCopiedOnce& newHeaders);
-  bool      IsReplaceHeader(const char *pHeader);
-
-private:
-  static nsIMsgIdentity *    s_pIdentity;
-
-  nsTArray<ImportAttachment*> *  m_pAttachments;
-  nsIMsgSendListener *  m_pListener;
-  nsIMsgCompFields *    m_pMsgFields;
-  nsCOMPtr<nsIIOService> m_pIOService;
-  int32_t          m_headerLen;
-  const char *      m_pHeaders;
-  int32_t          m_bodyLen;
-  const char *      m_pBody;
-  nsCString        m_bodyType;
-  nsString        m_defCharset;
-  SimpleBufferTonyRCopiedOnce      m_readHeaders;
-  nsCOMPtr<nsIImportService>  m_pImportService;
-  nsCString       m_defaultDate;  // Use this if no Date: header in msgs
-};
-
-
-#endif /* nsEudoraCompose_h__ */
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraEditor.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this
-* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-#include "nsEudoraEditor.h"
-#include "nsIArray.h"
-#include "nsComponentManagerUtils.h"
-#include "nsStringGlue.h"
-#include "nsMsgUtils.h"
-#include "nsNetUtil.h"
-#include "nsImportEmbeddedImageData.h"
-
-static char *     sEudoraEmbeddedContentLines[] = {
-  "Embedded Content: ",
-  "\0"  //  Explicit terminating string
-};
-
-// Lightly adapted from code in Windows Eudora that hashes the img src cid.
-static uint32_t EudoraHashString(const char* pszStr)
-{
-  uint32_t        ulSum = 0;
-  const uint32_t  kKRHashPrime = 2147483629;
-
-  // algorithm: KRHash---derived from Karp & Rabin, Harvard Center for Research
-  // in Computing Technology Tech. Report TR-31-81. The constant prime number,
-  // kKRHashPrime, happens to be the largest prime number that will fit in
-  // 31 bits, except for 2^31-1 itself.
-
-  for (; *pszStr; pszStr++)
-  {
-    for (int32_t nBit = 0x80; nBit != 0; nBit >>= 1)
-    {
-      ulSum += ulSum;
-      if (ulSum >= kKRHashPrime)
-        ulSum -= kKRHashPrime;
-      if ((*pszStr) & nBit)
-        ++ulSum;
-      if (ulSum>= kKRHashPrime)
-        ulSum -= kKRHashPrime;
-    }
-  }
-
-  return ulSum + 1;
-}
-
-
-nsEudoraEditor::nsEudoraEditor(const char * pBody, nsIFile * pMailImportLocation)
-  : m_body(pBody)
-{
-  m_pMailImportLocation = pMailImportLocation;
-}
-
-
-nsEudoraEditor::~nsEudoraEditor()
-{
-}
-
-nsresult nsEudoraEditor::GetEmbeddedObjects(nsIArray ** aNodeList)
-{
-  NS_ENSURE_ARG_POINTER(aNodeList);
-
-  // Check to see if we were already called
-  if (m_EmbeddedObjectList != nullptr)
-  {
-    *aNodeList = m_EmbeddedObjectList;
-    return NS_OK;
-  }
-
-  // Create array in m_EmbeddedObjectList
-  nsresult rv;
-  m_EmbeddedObjectList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Return m_EmbeddedObjectList in aNodeList and increment ref count - caller
-  // assumes that we incremented the ref count.
-  NS_IF_ADDREF(*aNodeList = m_EmbeddedObjectList);
-
-  // Create the embedded folder spec
-  nsCOMPtr<nsIFile>   embeddedFolderSpec;
-  // Create the embedded image spec
-  nsCOMPtr<nsIFile>   embeddedImageSpec;
-
-  // Fill in the details for the embedded folder spec - "Embedded" folder
-  // inside of the mail folder. We don't bother to check to see if the embedded
-  // folder exists, because it seems to me that would only save time in the
-  // unexpected case where it doesn't exist. Keep in mind that we will be checking
-  // for the existence of any embedded images anyway - if the folder doesn't
-  // exist that check will fail.
-  rv = m_pMailImportLocation->Clone(getter_AddRefs(embeddedFolderSpec));
-  NS_ENSURE_SUCCESS(rv, rv);
-  embeddedFolderSpec->AppendNative(NS_LITERAL_CSTRING("Embedded"));
-
-  // Look for the start of the last closing tag so that we only search for
-  // valid "Embedded Content" lines. (In practice this is not super important,
-  // but there were some proof of concept exploits at one point where "Embedded
-  // Content" lines were faked in the body of messages).
-  int32_t     startLastClosingTag = m_body.RFind("</");
-  if (startLastClosingTag == kNotFound)
-    startLastClosingTag = 0;
-  bool        foundEmbeddedContentLines = false;
-
-  // Search for various translations of "Embedded Content" - as of this writing only
-  // one that I know of, but then again I didn't realize that Eudora translators had
-  // ever translated "Attachment Converted" as suggested by other Eudora importing code.
-  for (int32_t i = 0; *sEudoraEmbeddedContentLines[i] != '\0'; i++)
-  {
-    // Search for "Embedded Content: " lines starting after last closing tag (if any)
-    int32_t   startEmbeddedContentLine = startLastClosingTag;
-    int32_t   lenEmbeddedContentTag = strlen(sEudoraEmbeddedContentLines[i]);
-
-    while ((startEmbeddedContentLine = m_body.Find(sEudoraEmbeddedContentLines[i],
-                                                   true,
-                                                   startEmbeddedContentLine+1)) != kNotFound)
-    {
-      // Found this translation of "Embedded Content" - remember that so that we don't
-      // bother looking for any other translations.
-      foundEmbeddedContentLines = true;
-
-      // Extract the file name from the embedded content line
-      int32_t   startFileName = startEmbeddedContentLine + lenEmbeddedContentTag;
-      int32_t   endFileName = m_body.Find(":", false, startFileName);
-
-      // Create the file spec for the embedded image
-      embeddedFolderSpec->Clone(getter_AddRefs(embeddedImageSpec));
-      embeddedImageSpec->Append(Substring(m_body, startFileName, endFileName - startFileName));
-
-      // Verify that the embedded image spec exists and is a file
-      bool      isFile = false;
-      bool      exists = false;
-      if (NS_FAILED(embeddedImageSpec->Exists(&exists)) || NS_FAILED(embeddedImageSpec->IsFile(&isFile)))
-        continue;
-      if (!exists || !isFile)
-        continue;
-
-      // Extract CID hash from the embedded content line
-      int32_t     cidHashValue;
-      int32_t     startCIDHash = m_body.Find(",", false, endFileName);
-      if (startCIDHash != kNotFound)
-      {
-        startCIDHash++;
-        int32_t   endCIDHash = m_body.Find(",", false, startCIDHash);
-
-        if (endCIDHash != kNotFound)
-        {
-          nsString    cidHash;
-          cidHash.Assign(Substring(m_body, startCIDHash, endCIDHash - startCIDHash));
-
-          if (!cidHash.IsEmpty())
-          {
-            // Convert CID hash string to numeric value
-            nsresult aErrorCode;
-            cidHashValue = cidHash.ToInteger(&aErrorCode, 16);
-          }
-        }
-      }
-
-      // Get the URL for the embedded image
-      nsCString     embeddedImageURL;
-      rv = NS_GetURLSpecFromFile(embeddedImageSpec, embeddedImageURL);
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      NS_ConvertASCIItoUTF16 srcUrl(embeddedImageURL);
-      nsString cid;
-      // We're going to remember the original cid in the image element,
-      // which the send code will retrieve as the kMozCIDAttrName property.
-      GetEmbeddedImageCID(cidHashValue, srcUrl, cid);
-      nsCOMPtr<nsIURI> embeddedFileURI;
-      NS_NewFileURI(getter_AddRefs(embeddedFileURI), embeddedImageSpec);
-
-      // Create the embedded image node
-      nsImportEmbeddedImageData *imageData =
-        new nsImportEmbeddedImageData(embeddedFileURI, NS_LossyConvertUTF16toASCII(cid));
-
-      // Append the embedded image node to the list
-      m_EmbeddedObjectList->AppendElement(imageData, false);
-
-      int32_t   endEmbeddedContentLine = m_body.Find("\r\n", true, startEmbeddedContentLine+1);
-      if (endEmbeddedContentLine != kNotFound)
-      {
-        // We recognized the "Embedded Content" line correctly and found the associated image.
-        // Remove the Eudora specific line about it now.
-        m_body.Cut(startEmbeddedContentLine, endEmbeddedContentLine - startEmbeddedContentLine + 2);
-
-        // Backup by one to correct where we start looking for the next line
-        startEmbeddedContentLine--;
-      }
-    }
-
-    // Assume at most one translation for "Embedded Content: " in a given message
-    if (foundEmbeddedContentLines)
-      break;
-  }
-
-  return NS_OK;
-}
-
-bool nsEudoraEditor::GetEmbeddedImageCID(uint32_t aCIDHash, const nsAString & aOldRef, nsString &aCID)
-{
-  bool      foundMatch = false;
-  int32_t   startImageTag = 0;
-  int32_t   closeImageTag = 0;
-
-  while ((startImageTag = m_body.Find("<img", true, closeImageTag)) != kNotFound)
-  {
-    closeImageTag = m_body.Find(">", false, startImageTag);
-
-    // We should always find a close tag, bail if we don't
-    if (closeImageTag == kNotFound)
-      break;
-
-    // Find the source attribute and make sure it's for our image tag
-    int32_t   startSrcValue = m_body.Find("src", true, startImageTag);
-    if ((startSrcValue == kNotFound) || (startSrcValue > closeImageTag))
-      continue;
-
-    // Move past the src
-    startSrcValue += 3;
-
-    // Move past any whitespace
-    while (isspace(m_body.CharAt(startSrcValue)))
-      ++startSrcValue;
-
-    // We should find an = now
-    if (m_body.CharAt(startSrcValue) != '=')
-      continue;
-
-    // Move past =
-    ++startSrcValue;
-
-    // Move past any whitespace
-    while (isspace(m_body.CharAt(startSrcValue)))
-      ++startSrcValue;
-
-    // Get the quote char and verify that it's valid
-    char    quoteChar = static_cast <char> (m_body.CharAt(startSrcValue));
-    if ((quoteChar != '"') && (quoteChar != '\''))
-      continue;
-
-    // Move past the quote
-    ++startSrcValue;
-
-    int32_t   endSrcValue = m_body.FindChar(quoteChar, startSrcValue);
-    int32_t   srcLength = endSrcValue - startSrcValue;
-
-    nsString  srcValue;
-    aCID.Assign(Substring(m_body, startSrcValue, srcLength));
-
-    if (aCIDHash != 0)
-    {
-      // Verify source value starts with "cid:"
-      if (!StringBeginsWith(aCID, NS_LITERAL_STRING("cid:"), nsCaseInsensitiveStringComparator()))
-        continue;
-
-      // Remove "cid:" from the start
-      aCID.Cut(0, 4);
-
-      uint32_t  hashValue = EudoraHashString(NS_LossyConvertUTF16toASCII(aCID).get());
-      foundMatch = (hashValue == aCIDHash);
-    }
-    else
-    {
-      foundMatch = aCID.Equals(aOldRef);
-    }
-  }
-
-  return foundMatch;
-}
-
-
-bool nsEudoraEditor::HasEmbeddedContent()
-{
-  // Simple quick test to see if there's any embedded content lines
-  bool     bHasEmbeddedContent = false;
-
-  for (int32_t i = 0; *sEudoraEmbeddedContentLines[i] != '\0'; i++)
-  {
-    bHasEmbeddedContent = (m_body.Find(sEudoraEmbeddedContentLines[i], true, 0) != kNotFound);
-
-    if (bHasEmbeddedContent)
-      break;
-  }
-
-  return bHasEmbeddedContent;
-}
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraEditor.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this
-* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nscore.h"
-#include "nsIEditor.h"
-#include "nsIEditorMailSupport.h"
-#include "nsCOMPtr.h"
-#include "nsStringGlue.h"
-#include "nsIFile.h"
-#include "nsIMutableArray.h"
-
-
-class nsEudoraEditor
-{
-  public:
-    nsEudoraEditor(const char * pBody, nsIFile * pMailImportLocation);
-    ~nsEudoraEditor();
-
-    bool GetEmbeddedImageCID(uint32_t aCIDHash, const nsAString & aOldRef, nsString &aCID);
-    bool HasEmbeddedContent();
-    nsresult GetEmbeddedObjects(nsIArray ** aNodeList);
-    nsresult GetBody(nsAString & _retval) {_retval = m_body; return NS_OK;}
-  protected:
-    NS_ConvertASCIItoUTF16      m_body;
-    nsCOMPtr <nsIFile>          m_pMailImportLocation;
-    nsCOMPtr<nsIMutableArray>   m_EmbeddedObjectList; // Initialized when GetEmbeddedObjects is called
-};
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraFilters.cpp
+++ /dev/null
@@ -1,924 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
-  Eudora filters
-*/
-
-#include "nsCOMPtr.h"
-#include "nscore.h"
-#include "nsCRTGlue.h"
-#include "nspr.h"
-#include "plstr.h"
-#include "nsMsgBaseCID.h"
-#include "nsMsgUtils.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
-#include "nsIMsgFilterList.h"
-#include "nsIMsgSearchTerm.h"
-#include "nsIMsgAccountManager.h"
-#include "nsIStringBundle.h"
-#include "mozilla/Services.h"
-#include "nsIMsgFilter.h"
-#include "nsEudoraFilters.h"
-#include "nsEudoraStringBundle.h"
-#include "nsIArray.h"
-#include "nsArrayUtils.h"
-#include "nsNetUtil.h"
-#include "nsILineInputStream.h"
-#include "EudoraDebugLog.h"
-
-#if defined(XP_WIN)
-#include "nsEudoraWin32.h"
-#endif
-#ifdef XP_MACOSX
-#include "nsEudoraMac.h"
-#endif
-
-
-
-////////////////////////////////////////////////////////////////////////
-nsresult nsEudoraFilters::Create(nsIImportFilters** aImport)
-{
-  NS_ENSURE_ARG_POINTER(aImport);
-  *aImport = new nsEudoraFilters();
-  NS_IF_ADDREF(*aImport);
-
-  return *aImport? NS_OK : NS_ERROR_OUT_OF_MEMORY;
-}
-
-nsEudoraFilters::nsEudoraFilters()
-{
-}
-
-nsEudoraFilters::~nsEudoraFilters()
-{
-}
-
-NS_IMPL_ISUPPORTS(nsEudoraFilters, nsIImportFilters)
-
-NS_IMETHODIMP nsEudoraFilters::AutoLocate(char16_t **aDescription, nsIFile **aLocation, bool *_retval)
-{
-  NS_ENSURE_ARG_POINTER(aDescription);
-  NS_ENSURE_ARG_POINTER(aLocation);
-  NS_ENSURE_ARG_POINTER(_retval);
-
-  *aDescription = nullptr;
-  *_retval = false;
-
-  nsresult rv;
-  m_pLocation =  do_CreateInstance (NS_LOCAL_FILE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  *aDescription = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_NAME);
-
-#if defined(XP_WIN)
-  *_retval = nsEudoraWin32::FindFiltersFile(getter_AddRefs(m_pLocation));
-#endif
-#ifdef XP_MACOSX
-  *_retval = nsEudoraMac::FindFiltersFile(getter_AddRefs(m_pLocation));
-#endif
-
-  NS_IF_ADDREF(*aLocation = m_pLocation);
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsEudoraFilters::SetLocation(nsIFile *aLocation)
-{
-  m_pLocation = aLocation;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsEudoraFilters::Import(char16_t **aError, bool *_retval)
-{
-  NS_ENSURE_ARG_POINTER(aError);
-  NS_ENSURE_ARG_POINTER(_retval);
-  nsresult rv;
-
-  *_retval = false;
-  *aError = nullptr;
-
-  // Get the settings file if it doesn't exist
-  if (!m_pLocation)
-  {
-    m_pLocation =  do_CreateInstance (NS_LOCAL_FILE_CONTRACTID, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-#if defined(XP_WIN)
-    if (!nsEudoraWin32::FindFiltersFile(getter_AddRefs(m_pLocation)))
-      m_pLocation = nullptr;
-#endif
-#ifdef XP_MACOSX
-    if (!nsEudoraMac::FindFiltersFile(getter_AddRefs(m_pLocation)))
-      m_pLocation = nullptr;
-#endif
-  }
-
-  if (!m_pLocation)
-  {
-    IMPORT_LOG0("*** Error, unable to locate filters file for import.\n");
-    return NS_ERROR_FAILURE;
-  }
-
-  // Now perform actual importing task
-  *_retval = RealImport();
-  *aError = ToNewUnicode(m_errorLog);
-
-  if (*_retval)
-    IMPORT_LOG0("Successful import of eudora filters\n");
-  else
-    IMPORT_LOG0("*** Error, Unsuccessful import of eudora filters\n");
-
-  return NS_OK;
-}
-
-bool nsEudoraFilters::RealImport()
-{
-  nsresult rv;
-
-  rv = Init();
-  if (NS_FAILED(rv))
-  {
-    IMPORT_LOG0("*** Error initializing filter import process\n");
-    return false;
-  }
-
-  nsCOMPtr <nsIInputStream> inputStream;
-  rv = NS_NewLocalFileInputStream(getter_AddRefs(inputStream), m_pLocation);
-
-  if (NS_FAILED(rv))
-  {
-    IMPORT_LOG0("*** Error opening filters file for reading\n");
-    return false;
-  }
-
-  rv = LoadServers();
-  if (NS_FAILED(rv))
-  {
-    IMPORT_LOG0("*** Error loading servers with filters\n");
-    return false;
-  }
-
-  nsCOMPtr<nsILineInputStream> lineStream(do_QueryInterface(inputStream, &rv));
-  NS_ENSURE_SUCCESS(rv, false);
-
-  nsCString     line;
-  bool          more = true;
-  nsAutoCString header;
-  nsAutoCString verb;
-  nsAutoString  name;
-
-  // Windows Eudora filters files have a version header as a first line - just skip it
-#if defined(XP_WIN)
-  rv = lineStream->ReadLine(line, &more);
-#endif
-
-  while (more && NS_SUCCEEDED(rv))
-  {
-    rv = lineStream->ReadLine(line, &more);
-    const char* pLine = line.get();
-    if (NS_SUCCEEDED(rv))
-    {
-      // New filters start with a "rule <name>" line
-      if (!strncmp(pLine, "rule ", 5))
-      {
-        rv = FinalizeFilter();
-        if (NS_SUCCEEDED(rv))
-        {
-          const char* pName = pLine + 5;
-          NS_CopyNativeToUnicode(nsCString(pName), name);
-          rv = CreateNewFilter(pName);
-        }
-      }
-#ifdef XP_MACOSX
-      else if (!strncmp(pLine, "id ", 3))
-        ;// ids have no value to us, but we don't want them to produce a warning either
-#endif
-      else if (!strncmp(pLine, "conjunction ", 12))
-      {
-        const char* cj = pLine + 12;
-        if (!strcmp(cj, "and"))
-          m_isAnd = true;
-        else if (!strcmp(cj, "unless"))
-          m_isUnless = true;
-        else if (!strcmp(cj, "ignore"))
-          m_ignoreTerm = true;
-      }
-      else if (!strncmp(pLine, "header ", 7))
-        header = (pLine + 7);
-      else if (!strncmp(pLine, "verb ", 5))
-        verb = (pLine + 5);
-      else if (!strncmp(pLine, "value ", 6))
-      {
-        if (!m_ignoreTerm)
-        {
-          rv = AddTerm(header.get(), verb.get(), pLine + 6, (m_isAnd || m_isUnless), m_isUnless);
-          // For now, ignoring terms that can't be represented in TB filters
-          if (rv == NS_ERROR_INVALID_ARG)
-          {
-            rv = NS_OK;
-            m_termNotGroked = true;
-          }
-        }
-      }
-      else if (!strcmp(pLine, "incoming"))
-        m_isIncoming = true;
-      else if (!strncmp(pLine, "transfer ", 9) ||
-               !strncmp(pLine, "copy ", 5))
-      {
-        const char* pMailboxPath = strchr(pLine, ' ') + 1;
-        bool isTransfer = (*pLine == 't');
-        rv = AddMailboxAction(pMailboxPath, isTransfer);
-        if (rv == NS_ERROR_INVALID_ARG)
-        {
-          nsAutoString unicodeMailboxPath;
-          NS_CopyNativeToUnicode(nsCString(pMailboxPath), unicodeMailboxPath);
-          m_errorLog += NS_LITERAL_STRING("- ");
-          m_errorLog += name;
-          m_errorLog += NS_LITERAL_STRING(": ");
-          m_errorLog += nsEudoraStringBundle::FormatString(EUDORAIMPORT_FILTERS_WARN_MAILBOX_MISSING, unicodeMailboxPath.get());
-          m_errorLog += NS_LITERAL_STRING("\n");
-          rv = NS_OK;
-        }
-      }
-      // Doing strncmp() here because Win Eudora puts a space after "stop" but Mac Eudora doesn't
-      else if (!strncmp(pLine, "stop", 4))
-        m_hasStop = true;
-      else if (!strncmp(pLine, "forward ", 8))
-        rv = AddStringAction(nsMsgFilterAction::Forward, pLine + 8);
-      else if (!strncmp(pLine, "reply ", 6))
-        rv = AddStringAction(nsMsgFilterAction::Reply, pLine + 6);
-      else if (!strncmp(pLine, "priority ", 9))
-      {
-        // Win Eudora's  priority values are 0 (highest) to 4 (lowest)
-        // Mac Eudora's  priority values are 1 (highest) to 5 (lowest)
-        // Thunderbird's priority values are 6 (highest) to 2 (lowest)
-        int32_t TBPriority = 6 - atoi(pLine + 9);
-#ifdef XP_MACOSX
-        TBPriority++;
-#endif
-        rv = AddPriorityAction(TBPriority);
-      }
-      else if (!strncmp(pLine, "label ", 6))
-      {
-        nsAutoCString tagName("$label");
-        tagName += pLine + 6;
-        rv = AddStringAction(nsMsgFilterAction::AddTag, tagName.get());
-      }
-      // Doing strncmp() here because Win Eudora puts a space after "junk" but Mac Eudora doesn't
-      else if (!strncmp(pLine, "junk", 4))
-        rv = AddJunkAction(100);
-      else if (!strncmp(pLine, "status ", 7))
-      {
-        // Win Eudora's read status is 1, whereas Mac Eudora's read status is 2
-        uint32_t status = atoi(pLine + 7);
-#ifdef XP_MACOSX
-        status--;
-#endif
-        if (status == 1)
-          rv = AddAction(nsMsgFilterAction::MarkRead);
-      }
-      else if (!strncmp(pLine, "serverOpt ", 10))
-      {
-        // Win and Mac Eudora have the two bits swapped in the file
-        uint32_t bits = atoi(pLine + 10);
-#if defined(XP_WIN)
-        bool bFetch  = (bits & 1);
-        bool bDelete = (bits & 2);
-#endif
-#ifdef XP_MACOSX
-        bool bFetch  = (bits & 2);
-        bool bDelete = (bits & 1);
-#endif
-        rv = AddAction(bDelete? (nsMsgRuleActionType)nsMsgFilterAction::DeleteFromPop3Server : (nsMsgRuleActionType)nsMsgFilterAction::LeaveOnPop3Server);
-        if (NS_SUCCEEDED(rv) && bFetch)
-          rv = AddAction(nsMsgFilterAction::FetchBodyFromPop3Server);
-      }
-      else if (strcmp(pLine, "manual") == 0)
-        ;// Just ignore manual as TB handles manual in a different way
-      else if (strcmp(pLine, "outgoing") == 0)
-      {
-        m_errorLog += NS_LITERAL_STRING("- ");
-        m_errorLog += name;
-        m_errorLog += NS_LITERAL_STRING(": ");
-        m_errorLog += nsEudoraStringBundle::FormatString(EUDORAIMPORT_FILTERS_WARN_OUTGOING);
-        m_errorLog += NS_LITERAL_STRING("\n");
-      }
-      else
-      {
-        nsAutoString unicodeLine;
-        NS_CopyNativeToUnicode(nsCString(pLine), unicodeLine);
-        m_errorLog += NS_LITERAL_STRING("- ");
-        m_errorLog += name;
-        m_errorLog += NS_LITERAL_STRING(": ");
-        m_errorLog += nsEudoraStringBundle::FormatString(EUDORAIMPORT_FILTERS_WARN_ACTION, unicodeLine.get());
-        m_errorLog += NS_LITERAL_STRING("\n");
-      }
-    }
-  }
-
-  // Process the last filter
-  if (!more && NS_SUCCEEDED(rv))
-    rv = FinalizeFilter();
-
-  inputStream->Close();
-
-  if (more)
-  {
-    IMPORT_LOG0("*** Error reading the filters, didn't reach the end\n");
-    return false;
-  }
-
-  rv = SaveFilters();
-
-  return NS_SUCCEEDED(rv);
-}
-
-nsresult nsEudoraFilters::Init()
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIMsgAccountManager> accMgr = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr <nsIMsgIncomingServer> server;
-  rv = accMgr->GetLocalFoldersServer(getter_AddRefs(server));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr <nsIMsgFolder> localRootFolder;
-  rv = server->GetRootMsgFolder(getter_AddRefs(localRootFolder));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // we need to call GetSubFolders() so that the folders get initialized
-  // if they are not initialized yet.
-  nsCOMPtr<nsISimpleEnumerator> enumerator;
-  rv = localRootFolder->GetSubFolders(getter_AddRefs(enumerator));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Get the name of the folder where one-off imported mail is placed
-  nsAutoString folderName(NS_LITERAL_STRING("Eudora Import"));
-  nsCOMPtr<nsIStringBundleService> bundleService = 
-    mozilla::services::GetStringBundleService();
-  NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
-
-  nsCOMPtr<nsIStringBundle> bundle;
-  rv = bundleService->CreateBundle("chrome://messenger/locale/importMsgs.properties",
-                                   getter_AddRefs(bundle));
-  if (NS_SUCCEEDED(rv))
-  {
-    nsAutoString Eudora(NS_LITERAL_STRING("Eudora"));
-    const char16_t *moduleName[] = { Eudora.get() };
-    rv = bundle->FormatStringFromName(MOZ_UTF16("ImportModuleFolderName"),
-                                      moduleName, 1, getter_Copies(folderName));
-  }
-  localRootFolder->GetChildNamed(folderName, getter_AddRefs(m_pMailboxesRoot));
-  if (!m_pMailboxesRoot)
-  {
-    // If no "Eudora Import" folder then this is a
-    // migration which just puts it in the root
-    m_pMailboxesRoot = localRootFolder;
-  }
-
-  return rv;
-}
-
-nsresult nsEudoraFilters::LoadServers()
-{
-  nsresult rv;
-
-  if (m_pServerArray)
-    rv = m_pServerArray->Clear();
-  else
-    m_pServerArray = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!m_pFilterArray)
-    m_pFilterArray = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIMsgAccountManager> accountMgr = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIArray> allServers;
-  rv = accountMgr->GetAllServers(getter_AddRefs(allServers));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  uint32_t numServers;
-  rv = allServers->GetLength(&numServers);
-  NS_ENSURE_SUCCESS(rv, rv);
-  for (uint32_t serverIndex = 0; serverIndex < numServers; serverIndex++)
-  {
-    nsCOMPtr<nsIMsgIncomingServer> server = do_QueryElementAt(allServers, serverIndex, &rv);
-    if (server && NS_SUCCEEDED(rv))
-    {
-      bool canHaveFilters;
-      rv = server->GetCanHaveFilters(&canHaveFilters);
-      if (NS_SUCCEEDED(rv) && canHaveFilters)
-      {
-        nsAutoCString serverType;
-        rv = server->GetType(serverType);
-        if (NS_SUCCEEDED(rv) && !serverType.IsEmpty())
-        {
-          // Only get imap accounts and the special "none" (Local Folders) account
-          // since all imported Eudora pop3 accounts will go to Local Folders
-          if (serverType.Equals("none") || serverType.Equals("imap"))
-          {
-            // Pre-fetch filters now so that if there's any problem reading up the
-            // filter file we know about it in advance and can stop importing
-            nsCOMPtr<nsIMsgFilterList> filterList;
-            rv = server->GetFilterList(nullptr, getter_AddRefs(filterList));
-            NS_ENSURE_SUCCESS(rv, rv);
-
-            m_pServerArray->AppendElement(server, false);
-          }
-        }
-      }
-    }
-  }
-
-  return NS_OK;
-}
-
-nsresult nsEudoraFilters::SaveFilters()
-{
-  nsresult rv;
-
-  uint32_t numServers;
-  rv = m_pServerArray->GetLength(&numServers);
-  NS_ENSURE_SUCCESS(rv, rv);
-  for (uint32_t serverIndex = 0; serverIndex < numServers; serverIndex++)
-  {
-    nsCOMPtr<nsIMsgIncomingServer> server = do_QueryElementAt(m_pServerArray, serverIndex, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr <nsIMsgFilterList> filterList;
-    rv = server->GetFilterList(nullptr, getter_AddRefs(filterList));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = filterList->SaveToDefaultFile();
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  return NS_OK;
-}
-
-nsresult nsEudoraFilters::CreateNewFilter(const char* pName)
-{
-  nsresult rv;
-
-  rv = m_pFilterArray->Clear();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsAutoString unicodeName;
-  NS_CopyNativeToUnicode(nsCString(pName), unicodeName);
-  uint32_t numServers;
-  rv = m_pServerArray->GetLength(&numServers);
-  NS_ENSURE_SUCCESS(rv, rv);
-  for (uint32_t serverIndex = 0; serverIndex < numServers; serverIndex++)
-  {
-    nsCOMPtr<nsIMsgIncomingServer> server = do_QueryElementAt(m_pServerArray, serverIndex, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr <nsIMsgFilterList> filterList;
-    rv = server->GetFilterList(nullptr, getter_AddRefs(filterList));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsIMsgFilter> newFilter;
-    rv = filterList->CreateFilter(unicodeName, getter_AddRefs(newFilter));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = newFilter->SetEnabled(false);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    uint32_t count;
-    rv = filterList->GetFilterCount(&count);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = filterList->InsertFilterAt(count, newFilter);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    m_pFilterArray->AppendElement(newFilter, false);
-  }
-
-  m_isAnd = false;
-  m_isUnless = false;
-  m_ignoreTerm = false;
-  m_isIncoming = false;
-  m_addedAction = false;
-  m_hasTransfer = false;
-  m_hasStop = false;
-  m_termNotGroked = false;
-
-  return NS_OK;
-}
-
-nsresult nsEudoraFilters::FinalizeFilter()
-{
-  nsresult rv = NS_OK;
-
-  // Transfer actions always stop filtering, so only add a stop action when there
-  // was no transfer action in order to keep the filter action list cleaner
-  if (m_hasStop && !m_hasTransfer)
-    AddAction(nsMsgFilterAction::StopExecution);
-
-  // TB only does filtering on incoming messages.
-  // Also, if you don't provide an action for a filter, TB will provide a default action of moving
-  // the message to the first mailbox in the first set of mailboxes.  Not what we want, so
-  // we disable the filter (gives the user a chance to add their own actions and enable).
-  // Lastly, only enable if all terms were fully understood.
-  if (m_isIncoming && m_addedAction && !m_termNotGroked)
-    rv = EnableFilter(true);
-
-  return rv;
-}
-
-nsresult nsEudoraFilters::EnableFilter(bool enable)
-{
-  nsresult rv;
-
-  uint32_t numFilters;
-  rv = m_pFilterArray->GetLength(&numFilters);
-  NS_ENSURE_SUCCESS(rv, rv);
-  for (uint32_t filterIndex = 0; filterIndex < numFilters; filterIndex++)
-  {
-    nsCOMPtr<nsIMsgFilter> filter = do_QueryElementAt(m_pFilterArray, filterIndex, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    filter->SetEnabled(enable);
-  }
-
-  return NS_OK;
-}
-
-// Different character sets on Windows and Mac put left and right double angle quotes in different spots
-#if defined(XP_WIN)
-#define LDAQ "\xAB"
-#define RDAQ "\xBB"
-#elif XP_MACOSX
-#define LDAQ "\xC7"
-#define RDAQ "\xC8"
-#endif
-
-static const char* gStandardHeaders[] =
-{
-// Eudora string        nsMsgSearchAttribValue
-// -------------        ----------------------
-    "Subject:",                // Subject
-    "From:",                   // Sender
-    LDAQ "Body" RDAQ,          // Body
-    "Date:",                   // Date
-    "X-Priority:",             // Priority
-    "",                        // MsgStatus
-    "To:",                     // To
-    "Cc:",                     // CC
-    LDAQ "Any Recipient" RDAQ, // ToOrCC
-    NULL
-};
-
-static int32_t FindHeader(const char* pHeader)
-{
-  for (int32_t i = 0; gStandardHeaders[i]; i++)
-  {
-    if (*gStandardHeaders[i] && !PL_strcasecmp(pHeader, gStandardHeaders[i]))
-      return i;
-  }
-
-  return -1;
-}
-
-static const char* gOperators[] =
-{
-// Eudora string        nsMsgSearchOpValue
-// -------------        ------------------
-    "contains",         // Contains
-    "!contains",        // DoesntContain
-    "is",               // Is
-    "!is",              // Isnt
-    "",                 // IsEmpty
-    "",                 // IsBefore
-    "",                 // IsAfter
-    "",                 // IsHigherThan
-    "",                 // IsLowerThan
-    "starts",           // BeginsWith
-    "ends",             // EndsWith
-    "",                 // SoundsLike
-    "",                 // LdapDwim
-    "",                 // IsGreaterThan
-    "",                 // IsLessThan
-    "",                 // NameCompletion
-    "intersectsFile",   // IsInAB
-    "disjointFile",     // IsntInAB
-    NULL
-};
-
-static int32_t FindOperator(const char* pOperator)
-{
-  for (int32_t i = 0; gOperators[i]; i++)
-  {
-    if (*gOperators[i] && !strcmp(pOperator, gOperators[i]))
-      return i;
-  }
-
-  return -1;
-}
-
-#define MAILNEWS_CUSTOM_HEADERS "mailnews.customHeaders"
-
-static int32_t AddCustomHeader(const char* pHeader)
-{
-  nsresult rv;
-  int32_t index = -1;
-  nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
-  NS_ENSURE_SUCCESS(rv, index);
-
-  nsAutoCString headers;
-  pref->GetCharPref(MAILNEWS_CUSTOM_HEADERS, getter_Copies(headers));
-  index = 0;
-  if (!headers.IsEmpty())
-  {
-    char *headersString = ToNewCString(headers);
-    nsAutoCString hdrStr;
-    hdrStr.Adopt(headersString);
-    hdrStr.StripWhitespace();  //remove whitespace before parsing
-
-    char *newStr = headersString;
-    char *token = NS_strtok(":", &newStr);
-    while (token)
-    {
-      if (!PL_strcasecmp(token, pHeader))
-        return index;
-      token = NS_strtok(":", &newStr);
-      index++;
-    }
-    headers += ":";
-  }
-  headers += pHeader;
-  pref->SetCharPref(MAILNEWS_CUSTOM_HEADERS, headers.get());
-
-  return index;
-}
-
-nsresult nsEudoraFilters::AddTerm(const char* pHeader, const char* pVerb, const char* pValue, bool booleanAnd, bool negateVerb)
-{
-  nsresult rv;
-
-  nsMsgSearchAttribValue attrib = FindHeader(pHeader);
-  nsMsgSearchOpValue     op = FindOperator(pVerb);
-  nsAutoCString          arbitraryHeader;
-  nsAutoString           unicodeHeader, unicodeVerb, unicodeValue;
-  nsAutoString           filterTitle;
-
-  NS_CopyNativeToUnicode(nsCString(pHeader), unicodeHeader);
-  NS_CopyNativeToUnicode(nsCString(pVerb), unicodeVerb);
-  NS_CopyNativeToUnicode(nsCString(pValue), unicodeValue);
-
-  filterTitle = NS_LITERAL_STRING("- ");
-  filterTitle += unicodeHeader;
-  filterTitle += NS_LITERAL_STRING(" ");
-  filterTitle += unicodeVerb;
-  filterTitle += NS_LITERAL_STRING(" ");
-  filterTitle += unicodeValue;
-  filterTitle += NS_LITERAL_STRING(": ");
-
-  if (op < 0)
-  {
-    m_errorLog += filterTitle;
-    m_errorLog += nsEudoraStringBundle::FormatString(EUDORAIMPORT_FILTERS_WARN_VERB, pVerb);
-    m_errorLog += NS_LITERAL_STRING("\n");
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (!pHeader || !*pHeader)
-  {
-    m_errorLog += filterTitle;
-    m_errorLog += nsEudoraStringBundle::FormatString(EUDORAIMPORT_FILTERS_WARN_EMPTY_HEADER);
-    m_errorLog += NS_LITERAL_STRING("\n");
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (negateVerb)
-  {
-    switch (op)
-    {
-      case nsMsgSearchOp::Contains:
-      case nsMsgSearchOp::Is:
-      case nsMsgSearchOp::IsInAB:
-        op++;
-        break;
-      case nsMsgSearchOp::DoesntContain:
-      case nsMsgSearchOp::Isnt:
-      case nsMsgSearchOp::IsntInAB:
-        op--;
-        break;
-      default:
-        m_errorLog += filterTitle;
-        m_errorLog += nsEudoraStringBundle::FormatString(EUDORAIMPORT_FILTERS_WARN_NEGATE_VERB, unicodeVerb.get());
-        m_errorLog += NS_LITERAL_STRING("\n");
-        return NS_ERROR_INVALID_ARG;
-    }
-  }
-
-  if (attrib < 0)
-  {
-    // Can't handle other Eudora meta-headers (Any Header, Personality, Junk Score)
-    if (*pHeader == *LDAQ)
-    {
-      m_errorLog += filterTitle;
-      m_errorLog += nsEudoraStringBundle::FormatString(EUDORAIMPORT_FILTERS_WARN_META_HEADER, unicodeHeader.get());
-      m_errorLog += NS_LITERAL_STRING("\n");
-      return NS_ERROR_INVALID_ARG;
-    }
-
-    // Arbitrary headers for filters don't like the colon at the end
-    arbitraryHeader = pHeader;
-    int32_t index = arbitraryHeader.FindChar(':');
-    if (index >= 0)
-      arbitraryHeader.SetLength(index);
-
-    int32_t headerIndex = AddCustomHeader(arbitraryHeader.get());
-    NS_ENSURE_TRUE(headerIndex >= 0, NS_ERROR_FAILURE);
-
-    attrib = nsMsgSearchAttrib::OtherHeader + 1 + headerIndex;
-  }
-
-  uint32_t numFilters;
-  rv = m_pFilterArray->GetLength(&numFilters);
-  NS_ENSURE_SUCCESS(rv, rv);
-  for (uint32_t filterIndex = 0; filterIndex < numFilters; filterIndex++)
-  {
-    nsCOMPtr<nsIMsgFilter> filter = do_QueryElementAt(m_pFilterArray, filterIndex, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsISupportsArray> terms;
-    rv = filter->GetSearchTerms(getter_AddRefs(terms));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsIMsgSearchTerm> term;
-    if (booleanAnd)
-    {
-      term = do_QueryElementAt(terms, 0, &rv);
-      if (NS_SUCCEEDED(rv) && term)
-      {
-        term->SetBooleanAnd(true);
-        term = nullptr;
-      }
-    }
-
-    rv = filter->CreateTerm(getter_AddRefs(term));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsIMsgSearchValue> value;
-    rv = term->GetValue(getter_AddRefs(value));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    value->SetAttrib(attrib);
-    value->SetStr(unicodeValue);
-    term->SetAttrib(attrib);
-    term->SetOp(op);
-    term->SetBooleanAnd(booleanAnd);
-    if (!arbitraryHeader.IsEmpty())
-      term->SetArbitraryHeader(arbitraryHeader);
-    term->SetValue(value);
-    filter->AppendTerm(term);
-  }
-
-  return NS_OK;
-}
-
-nsresult nsEudoraFilters::AddAction(nsMsgRuleActionType actionType, int32_t junkScore /*= 0*/, nsMsgLabelValue label/*= 0*/,
-                                    nsMsgPriorityValue priority/*= 0*/, const char* strValue/*= nullptr*/, const char* targetFolderUri/*= nullptr*/)
-{
-  nsresult rv;
-
-  uint32_t numFilters;
-  rv = m_pFilterArray->GetLength(&numFilters);
-  NS_ENSURE_SUCCESS(rv, rv);
-  for (uint32_t filterIndex = 0; filterIndex < numFilters; filterIndex++)
-  {
-    nsCOMPtr<nsIMsgFilter> filter = do_QueryElementAt(m_pFilterArray, filterIndex, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsIMsgRuleAction> action;
-    rv = filter->CreateAction(getter_AddRefs(action));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = action->SetType(actionType);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    switch (actionType)
-    {
-      case nsMsgFilterAction::MoveToFolder:
-      case nsMsgFilterAction::CopyToFolder:
-        rv = action->SetTargetFolderUri(nsAutoCString(targetFolderUri));
-        break;
-
-      case nsMsgFilterAction::ChangePriority:
-        rv = action->SetPriority(priority);
-        break;
-
-      case nsMsgFilterAction::JunkScore:
-        rv = action->SetJunkScore(junkScore);
-        break;
-
-      case nsMsgFilterAction::AddTag:
-      case nsMsgFilterAction::Reply:
-      case nsMsgFilterAction::Forward:
-        rv = action->SetStrValue(nsAutoCString(strValue));
-        break;
-
-      case nsMsgFilterAction::MarkRead:
-      case nsMsgFilterAction::StopExecution:
-      case nsMsgFilterAction::DeleteFromPop3Server:
-      case nsMsgFilterAction::LeaveOnPop3Server:
-      case nsMsgFilterAction::FetchBodyFromPop3Server:
-        // No parameters for these
-        break;
-
-      case nsMsgFilterAction::Delete:
-      case nsMsgFilterAction::KillThread:
-      case nsMsgFilterAction::WatchThread:
-      case nsMsgFilterAction::MarkFlagged:
-      case nsMsgFilterAction::Label:
-      default:
-        // Something we don't handle
-        return NS_ERROR_FAILURE;
-    }
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = filter->AppendAction(action);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  m_addedAction = true;
-
-  return rv;
-}
-
-
-nsresult nsEudoraFilters::AddMailboxAction(const char* pMailboxPath, bool isTransfer)
-{
-  nsresult rv;
-  nsCString nameHierarchy;
-#if defined(XP_WIN)
-  nsCString filePath;
-  m_pLocation->GetNativePath(filePath);
-  int32_t index = filePath.RFindChar('\\');
-  if (index >= 0)
-    filePath.SetLength(index);
-  if (!nsEudoraWin32::GetMailboxNameHierarchy(filePath, pMailboxPath,
-                                              nameHierarchy))
-    return NS_ERROR_INVALID_ARG;
-#endif
-#ifdef XP_MACOSX
-  nameHierarchy = pMailboxPath;
-#endif
-
-  nsCOMPtr<nsIMsgFolder> folder;
-  rv = GetMailboxFolder(nameHierarchy.get(), getter_AddRefs(folder));
-
-  nsAutoCString folderURI;
-  if (NS_SUCCEEDED(rv))
-    rv = folder->GetURI(folderURI);
-  if (NS_FAILED(rv))
-    return NS_ERROR_INVALID_ARG;
-
-  rv = AddAction(isTransfer? (nsMsgRuleActionType)nsMsgFilterAction::MoveToFolder : (nsMsgRuleActionType)nsMsgFilterAction::CopyToFolder, 0, 0, 0, nullptr, folderURI.get());
-
-  if (NS_SUCCEEDED(rv) && isTransfer)
-    m_hasTransfer = true;
-
-  return rv;
-}
-
-nsresult nsEudoraFilters::GetMailboxFolder(const char* pNameHierarchy, nsIMsgFolder** ppFolder)
-{
-  NS_ENSURE_ARG_POINTER(ppFolder);
-
-  nsCOMPtr<nsIMsgFolder> folder(*ppFolder ? *ppFolder : m_pMailboxesRoot.get());
-
-  // We've already grabbed the pointer on incoming, so now ensure
-  // *ppFolder is null on outgoing if there is an error
-  *ppFolder = nullptr;
-  
-  nsAutoCString name(pNameHierarchy + 1);
-  int32_t sepIndex = name.FindChar(*pNameHierarchy);
-  if (sepIndex >= 0)
-    name.SetLength(sepIndex);
-
-  nsAutoString unicodeName;
-  NS_CopyNativeToUnicode(name, unicodeName);
-
-  nsCOMPtr<nsIMsgFolder> subFolder;
-  nsresult rv = folder->GetChildNamed(unicodeName, getter_AddRefs(subFolder));
-  if (NS_SUCCEEDED(rv))
-  {
-    *ppFolder = subFolder;
-    if (sepIndex >= 0)
-      return GetMailboxFolder(pNameHierarchy + sepIndex + 1, ppFolder);
-    NS_IF_ADDREF(*ppFolder);
-  }
-
-  return rv;
-}
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraFilters.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsEudoraFilters_h___
-#define nsEudoraFilters_h___
-
-#include "nsIImportFilters.h"
-#include "nsIFile.h"
-#include "nsIMutableArray.h"
-#include "nsCOMPtr.h"
-#include "nsMsgFilterCore.h"
-
-class nsIMsgFolder;
-
-class nsEudoraFilters : public nsIImportFilters {
-public:
-  nsEudoraFilters();
-
-  static nsresult Create(nsIImportFilters** aImport);
-
-  // nsISupports interface
-  NS_DECL_ISUPPORTS
-
-  // nsIImportFilters interface
-  NS_DECL_NSIIMPORTFILTERS
-
-private:
-  virtual ~nsEudoraFilters();
-  nsCOMPtr<nsIFile> m_pLocation;
-  nsCOMPtr<nsIMutableArray> m_pServerArray;
-  nsCOMPtr<nsIMutableArray> m_pFilterArray;
-  nsCOMPtr<nsIMsgFolder> m_pMailboxesRoot;
-
-  nsString m_errorLog;
-
-  bool m_isAnd;
-  bool m_isUnless;
-  bool m_ignoreTerm;
-  bool m_isIncoming;
-  bool m_addedAction;
-  bool m_hasTransfer;
-  bool m_hasStop;
-  bool m_termNotGroked;
-
-  bool RealImport();
-  nsresult Init();
-  nsresult LoadServers();
-  nsresult SaveFilters();
-  nsresult CreateNewFilter(const char* pName);
-  nsresult FinalizeFilter();
-  nsresult EnableFilter(bool enable);
-  nsresult AddTerm(const char* pHeader, const char* pVerb, const char* pValue, bool addAnd, bool negateVerb);
-
-  nsresult AddAction(nsMsgRuleActionType actionType, int32_t junkScore = 0, nsMsgLabelValue label = 0,
-                     nsMsgPriorityValue priority = 0, const char* strValue = nullptr, const char* targetFolderUri = nullptr);
-  nsresult AddJunkAction(int32_t junkScore)
-           { return AddAction(nsMsgFilterAction::JunkScore, junkScore); }
-  nsresult AddLabelAction(nsMsgLabelValue label)
-           { return AddAction(nsMsgFilterAction::Label, 0, label); }
-  nsresult AddPriorityAction(nsMsgPriorityValue priority)
-           { return AddAction(nsMsgFilterAction::ChangePriority, 0, 0, priority); }
-  nsresult AddStringAction(nsMsgRuleActionType actionType, const char* strValue)
-           { return AddAction(actionType, 0, 0, 0, strValue); }
-  nsresult AddMailboxAction(const char* pMailboxPath, bool isTransfer);
-
-  nsresult GetMailboxFolder(const char* pNameHierarchy, nsIMsgFolder** ppFolder);
-};
-
-#endif /* nsEudoraFilters_h___ */
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraImport.cpp
+++ /dev/null
@@ -1,765 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-/*
-
-  Eudora import mail and addressbook interfaces
-
-*/
-#include "nscore.h"
-#include "nsCOMPtr.h"
-#include "nsStringGlue.h"
-#include "nsServiceManagerUtils.h"
-#include "nsIImportService.h"
-#include "nsComponentManagerUtils.h"
-#include "nsEudoraImport.h"
-#include "nsIMemory.h"
-#include "nsIMutableArray.h"
-#include "nsIImportService.h"
-#include "nsIImportMail.h"
-#include "nsIImportMailboxDescriptor.h"
-#include "nsIImportGeneric.h"
-#include "nsIImportAddressBooks.h"
-#include "nsIImportABDescriptor.h"
-#include "nsIImportSettings.h"
-#include "nsIImportFilters.h"
-#include "nsIImportFieldMap.h"
-#include "nsXPCOM.h"
-#include "nsISupportsPrimitives.h"
-#include "nsIOutputStream.h"
-#include "nsIAddrDatabase.h"
-#include "nsTextFormatter.h"
-#include "nsEudoraStringBundle.h"
-#include "nsIStringBundle.h"
-#include "nsEudoraCompose.h"
-#include "nsEudoraSettings.h"
-#include "nsEudoraFilters.h"
-#include "nsUnicharUtils.h"
-#include "nsIMsgTagService.h"
-#include "nsMsgBaseCID.h"
-
-
-#if defined(XP_WIN)
-#include "nsEudoraWin32.h"
-#endif
-#ifdef XP_MACOSX
-#include "nsEudoraMac.h"
-#endif
-
-#include "EudoraDebugLog.h"
-
-static NS_DEFINE_IID(kISupportsIID,      NS_ISUPPORTS_IID);
-PRLogModuleInfo *EUDORALOGMODULE = nullptr;
-
-class ImportEudoraMailImpl : public nsIImportMail
-{
-public:
-  ImportEudoraMailImpl();
-
-  static nsresult Create(nsIImportMail** aImport);
-
-  // nsISupports interface
-  NS_DECL_THREADSAFE_ISUPPORTS
-
-  // nsIImportmail interface
-
-  /* void GetDefaultLocation (out nsIFile location, out boolean found, out boolean userVerify); */
-  NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify);
-
-  /* nsIArray FindMailboxes (in nsIFile location); */
-  NS_IMETHOD FindMailboxes(nsIFile *location, nsIArray **_retval);
-
-  NS_IMETHOD ImportMailbox(nsIImportMailboxDescriptor *source,
-                           nsIMsgFolder *dstFolder,
-                           char16_t **pErrorLog, char16_t **pSuccessLog,
-                           bool *fatalError);
-
-  /* unsigned long GetImportProgress (); */
-  NS_IMETHOD GetImportProgress(uint32_t *_retval);
-
-  NS_IMETHOD TranslateFolderName(const nsAString & aFolderName, nsAString & _retval);
-
-public:
-  static void  AddLinebreak(nsString *pStream);
-  static void  SetLogs(nsString& success, nsString& error, char16_t **pError, char16_t **pSuccess);
-  static void ReportError(int32_t errorNum, nsString& name, nsString *pStream);
-
-
-private:
-  virtual ~ImportEudoraMailImpl();
-  static void  ReportSuccess(nsString& name, int32_t count, nsString *pStream);
-
-private:
-#if defined(XP_WIN)
-  nsEudoraWin32  m_eudora;
-#endif
-#ifdef XP_MACOSX
-  nsEudoraMac    m_eudora;
-#endif
-  uint32_t    m_bytes;
-};
-
-
-class ImportEudoraAddressImpl : public nsIImportAddressBooks
-{
-public:
-  ImportEudoraAddressImpl();
-
-  static nsresult Create(nsIImportAddressBooks** aImport);
-
-  // nsISupports interface
-  NS_DECL_THREADSAFE_ISUPPORTS
-
-  // nsIImportAddressBooks interface
-
-  NS_IMETHOD GetSupportsMultiple(bool *_retval) { *_retval = true; return NS_OK;}
-
-  NS_IMETHOD GetAutoFind(char16_t **description, bool *_retval);
-
-  NS_IMETHOD GetNeedsFieldMap(nsIFile *location, bool *_retval) { *_retval = false; return NS_OK;}
-
-  NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify);
-
-  NS_IMETHOD FindAddressBooks(nsIFile *location, nsIArray **_retval);
-
-  NS_IMETHOD InitFieldMap(nsIImportFieldMap *fieldMap)
-    { return NS_ERROR_FAILURE; }
-
-  NS_IMETHOD ImportAddressBook(nsIImportABDescriptor *source,
-                               nsIAddrDatabase *destination,
-                               nsIImportFieldMap *fieldMap,
-                               nsISupports *aSupportService,
-                               char16_t **errorLog,
-                               char16_t **successLog,
-                               bool *fatalError);
-
-  NS_IMETHOD GetImportProgress(uint32_t *_retval);
-
-  NS_IMETHOD GetSampleData(int32_t index, bool *pFound, char16_t **pStr)
-    { return NS_ERROR_FAILURE;}
-
-  NS_IMETHOD SetSampleLocation(nsIFile *) { return NS_OK; }
-
-private:
-  virtual ~ImportEudoraAddressImpl();
-  static void  ReportSuccess(nsString& name, nsString *pStream);
-
-private:
-#if defined(XP_WIN)
-  nsEudoraWin32  m_eudora;
-#endif
-#ifdef XP_MACOSX
-  nsEudoraMac    m_eudora;
-#endif
-  uint32_t    m_bytes;
-};
-
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-
-
-nsEudoraImport::nsEudoraImport()
-{
-  // Init logging module.
-  if (!EUDORALOGMODULE)
-    EUDORALOGMODULE = PR_NewLogModule("IMPORT");
-  IMPORT_LOG0("nsEudoraImport Module Created\n");
-
-  nsEudoraStringBundle::GetStringBundle();
-}
-
-
-nsEudoraImport::~nsEudoraImport()
-{
-  IMPORT_LOG0("nsEudoraImport Module Deleted\n");
-}
-
-
-
-NS_IMPL_ISUPPORTS(nsEudoraImport, nsIImportModule)
-
-
-NS_IMETHODIMP nsEudoraImport::GetName(char16_t **name)
-{
-  NS_PRECONDITION(name != nullptr, "null ptr");
-  if (! name)
-    return NS_ERROR_NULL_POINTER;
-
-  *name = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_NAME);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsEudoraImport::GetDescription(char16_t **name)
-{
-  NS_PRECONDITION(name != nullptr, "null ptr");
-  if (! name)
-    return NS_ERROR_NULL_POINTER;
-
-  *name = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_DESCRIPTION);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsEudoraImport::GetSupports(char **supports)
-{
-  NS_PRECONDITION(supports != nullptr, "null ptr");
-  if (! supports)
-    return NS_ERROR_NULL_POINTER;
-
-  *supports = strdup(kEudoraSupportsString);
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsEudoraImport::GetSupportsUpgrade(bool *pUpgrade)
-{
-  NS_PRECONDITION(pUpgrade != nullptr, "null ptr");
-  if (! pUpgrade)
-    return NS_ERROR_NULL_POINTER;
-
-  *pUpgrade = true;
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP nsEudoraImport::GetImportInterface(const char *pImportType, nsISupports **ppInterface)
-{
-  NS_PRECONDITION(pImportType != nullptr, "null ptr");
-  if (! pImportType)
-    return NS_ERROR_NULL_POINTER;
-  NS_PRECONDITION(ppInterface != nullptr, "null ptr");
-  if (! ppInterface)
-    return NS_ERROR_NULL_POINTER;
-
-  *ppInterface = nullptr;
-  nsresult  rv;
-  if (!strcmp(pImportType, "mail"))
-  {
-    // create the nsIImportMail interface and return it!
-    nsIImportMail *  pMail = nullptr;
-    nsIImportGeneric *pGeneric = nullptr;
-    rv = ImportEudoraMailImpl::Create(&pMail);
-    if (NS_SUCCEEDED(rv)) {
-      nsCOMPtr<nsIImportService> impSvc(do_GetService(NS_IMPORTSERVICE_CONTRACTID, &rv));
-      if (NS_SUCCEEDED(rv))
-      {
-        rv = impSvc->CreateNewGenericMail(&pGeneric);
-        if (NS_SUCCEEDED(rv))
-        {
-          pGeneric->SetData("mailInterface", pMail);
-          nsString name;
-          nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_NAME, name);
-          nsCOMPtr<nsISupportsString> nameString (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv));
-          if (NS_SUCCEEDED(rv))
-          {
-            nameString->SetData(name);
-            pGeneric->SetData("name", nameString);
-            rv = pGeneric->QueryInterface(kISupportsIID, (void **)ppInterface);
-          }
-        }
-      }
-    }
-    NS_IF_RELEASE(pMail);
-    NS_IF_RELEASE(pGeneric);
-    return rv;
-  }
-
-  if (!strcmp(pImportType, "addressbook"))
-  {
-    // create the nsIImportMail interface and return it!
-    nsIImportAddressBooks *  pAddress = nullptr;
-    nsIImportGeneric *    pGeneric = nullptr;
-    rv = ImportEudoraAddressImpl::Create(&pAddress);
-    if (NS_SUCCEEDED(rv))
-    {
-      nsCOMPtr<nsIImportService> impSvc(do_GetService(NS_IMPORTSERVICE_CONTRACTID, &rv));
-      if (NS_SUCCEEDED(rv))
-      {
-        rv = impSvc->CreateNewGenericAddressBooks(&pGeneric);
-        if (NS_SUCCEEDED(rv))
-        {
-          pGeneric->SetData("addressInterface", pAddress);
-          rv = pGeneric->QueryInterface(kISupportsIID, (void **)ppInterface);
-        }
-      }
-    }
-    NS_IF_RELEASE(pAddress);
-    NS_IF_RELEASE(pGeneric);
-    return rv;
-  }
-
-  if (!strcmp(pImportType, "settings"))
-  {
-    nsIImportSettings *pSettings = nullptr;
-    rv = nsEudoraSettings::Create(&pSettings);
-    if (NS_SUCCEEDED(rv))
-      pSettings->QueryInterface(kISupportsIID, (void **)ppInterface);
-    NS_IF_RELEASE(pSettings);
-    return rv;
-  }
-
-  if (!strcmp(pImportType, "filters"))
-  {
-    nsIImportFilters *pFilters = nullptr;
-    rv = nsEudoraFilters::Create(&pFilters);
-    if (NS_SUCCEEDED(rv))
-      pFilters->QueryInterface(kISupportsIID, (void **)ppInterface);
-    NS_IF_RELEASE(pFilters);
-    return rv;
-  }
-
-  return NS_ERROR_NOT_AVAILABLE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////
-nsresult ImportEudoraMailImpl::Create(nsIImportMail** aImport)
-{
-  NS_PRECONDITION(aImport != nullptr, "null ptr");
-  if (! aImport)
-    return NS_ERROR_NULL_POINTER;
-
-  *aImport = new ImportEudoraMailImpl();
-  if (! *aImport)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  NS_ADDREF(*aImport);
-  return NS_OK;
-}
-
-ImportEudoraMailImpl::ImportEudoraMailImpl()
-{
-  nsEudoraCompose::CreateIdentity();
-  // Create keys to support the default Eudora label colors.
-  // Ideally importing the settings will have already created these,
-  // in which case we won't bother (we'll detect that each key already
-  // exists). But to be sure we need to create the keys here, at
-  // least until the infrastructure is improved in some fashion so
-  // that we can rely on settings *always* being imported before mail.
-  nsresult            rv;
-  nsCOMPtr<nsIMsgTagService>    pTagService = do_GetService(NS_MSGTAGSERVICE_CONTRACTID, &rv);
-
-  if (NS_SUCCEEDED(rv))
-  {
-    struct EudoraDefaultLabels
-    {
-      char *    key;
-      nsString  tag;
-      char *    color;
-    };
-
-#ifdef XP_MACOSX
-    // For now default to no labels on Mac
-    #define    kNumEudoraLabels    0
-
-    // Use one dummy entry for now as a placeholder to keep the Mac code valid,
-    // until we enter actual reasonable defaults for Mac builds.
-    EudoraDefaultLabels    defaultEudoraLabels[1] =
-                    { { "eudoralabel1", NS_LITERAL_STRING("Label 1"), "#FF6600" } };
-#else
-    // These aren't the actual default Windows Eudora colors. Rather they're the closest
-    // equivalents that I could find that Thunderbird supports. When importing actual
-    // label settings, we'll need to map Eudora colors to ones that are supported.
-    #define    kNumEudoraLabels    7
-    EudoraDefaultLabels    defaultEudoraLabels[kNumEudoraLabels] =
-                    { "eudoralabel1", NS_LITERAL_STRING("Label 1"), "#FF6600",
-                      "eudoralabel2", NS_LITERAL_STRING("Label 2"), "#FF0000",
-                      "eudoralabel3", NS_LITERAL_STRING("Label 3"), "#CC66CC",
-                      "eudoralabel4", NS_LITERAL_STRING("Label 4"), "#3366FF",
-                      "eudoralabel5", NS_LITERAL_STRING("Label 5"), "#000099",
-                      "eudoralabel6", NS_LITERAL_STRING("Label 6"), "#009900",
-                      "eudoralabel7", NS_LITERAL_STRING("Label 7"), "#663333" };
-#endif
-
-    nsCString      eudoraKey;
-    nsString      eudoraTag;
-    nsCString      eudoraColor;
-
-    for (int16_t i = 0; i < kNumEudoraLabels; i++)
-    {
-      eudoraKey = defaultEudoraLabels[i].key;
-      rv = pTagService->GetTagForKey(eudoraKey, eudoraTag);
-      if (NS_FAILED(rv) || eudoraTag.IsEmpty())
-      {
-        eudoraColor = defaultEudoraLabels[i].color;
-        rv = pTagService->AddTagForKey(eudoraKey, defaultEudoraLabels[i].tag, eudoraColor, EmptyCString());
-      }
-    }
-  }
-}
-
-
-ImportEudoraMailImpl::~ImportEudoraMailImpl()
-{
-  // We're done importing mail, so nsEudoraCompose no longer needs the identity
-  // that it creates when we import any mail.
-  nsEudoraCompose::ReleaseIdentity();
-}
-
-
-
-NS_IMPL_ISUPPORTS(ImportEudoraMailImpl, nsIImportMail)
-
-NS_IMETHODIMP ImportEudoraMailImpl::GetDefaultLocation(nsIFile **ppLoc, bool *found, bool *userVerify)
-{
-  NS_PRECONDITION(ppLoc != nullptr, "null ptr");
-  NS_PRECONDITION(found != nullptr, "null ptr");
-  NS_PRECONDITION(userVerify != nullptr, "null ptr");
-  if (!ppLoc || !found || !userVerify)
-    return NS_ERROR_NULL_POINTER;
-
-  *ppLoc = nullptr;
-  *found = m_eudora.FindMailFolder(ppLoc);
-  *userVerify = true;
-
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP ImportEudoraMailImpl::FindMailboxes(nsIFile *pLoc, nsIArray **ppArray)
-{
-  NS_PRECONDITION(pLoc != nullptr, "null ptr");
-  NS_PRECONDITION(ppArray != nullptr, "null ptr");
-  if (!pLoc || !ppArray)
-    return NS_ERROR_NULL_POINTER;
-
-  bool exists = false;
-  nsresult rv = pLoc->Exists(&exists);
-  if (NS_FAILED(rv) || !exists)
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
-  if (NS_FAILED(rv))
-  {
-    IMPORT_LOG0("FAILED to allocate the nsIMutableArray\n");
-    return rv;
-  }
-  rv = m_eudora.FindMailboxes(pLoc, array);
-  if (NS_FAILED(rv))
-    return rv;
-
-  array.forget(ppArray);
-
-  return NS_OK;
-}
-
-void ImportEudoraMailImpl::AddLinebreak(nsString *pStream)
-{
-  if (pStream)
-    pStream->Append(char16_t('\n'));
-}
-
-void ImportEudoraMailImpl::ReportSuccess(nsString& name, int32_t count, nsString *pStream)
-{
-  if (!pStream)
-    return;
-  // load the success string
-  char16_t *pFmt = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_MAILBOX_SUCCESS);
-  char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get(), count);
-  pStream->Append(pText);
-  nsTextFormatter::smprintf_free(pText);
-  nsEudoraStringBundle::FreeString(pFmt);
-  AddLinebreak(pStream);
-}
-
-void ImportEudoraMailImpl::ReportError(int32_t errorNum, nsString& name, nsString *pStream)
-{
-  if (!pStream)
-    return;
-  // load the error string
-  char16_t *pFmt = nsEudoraStringBundle::GetStringByID(errorNum);
-  char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get());
-  pStream->Append(pText);
-  nsTextFormatter::smprintf_free(pText);
-  nsEudoraStringBundle::FreeString(pFmt);
-  AddLinebreak(pStream);
-}
-
-
-void ImportEudoraMailImpl::SetLogs(nsString& success, nsString& error, char16_t **pError, char16_t **pSuccess)
-{
-  if (pError)
-    *pError = ToNewUnicode(error);
-  if (pSuccess)
-    *pSuccess = ToNewUnicode(success);
-}
-
-NS_IMETHODIMP
-ImportEudoraMailImpl::ImportMailbox(nsIImportMailboxDescriptor *pSource,
-                                    nsIMsgFolder *pDstFolder,
-                                    char16_t **pErrorLog,
-                                    char16_t **pSuccessLog,
-                                    bool *fatalError)
-{
-  NS_ENSURE_ARG_POINTER(pSource);
-  NS_ENSURE_ARG_POINTER(pDstFolder);
-  NS_ENSURE_ARG_POINTER(fatalError);
-
-  nsString  success;
-  nsString  error;
-  bool      abort = false;
-  nsString  name;
-  char16_t *  pName;
-  if (NS_SUCCEEDED(pSource->GetDisplayName(&pName)))
-  {
-    name = pName;
-    NS_Free(pName);
-  }
-
-  uint32_t mailSize = 0;
-  pSource->GetSize(&mailSize);
-  if (mailSize == 0)
-  {
-    IMPORT_LOG0("Mailbox size is 0, skipping mailbox.\n");
-    ReportSuccess(name, 0, &success);
-    SetLogs(success, error, pErrorLog, pSuccessLog);
-    return NS_OK;
-  }
-
-
-  nsCOMPtr <nsIFile>  inFile;
-  if (NS_FAILED(pSource->GetFile(getter_AddRefs(inFile))))
-  {
-    ReportError(EUDORAIMPORT_MAILBOX_BADSOURCEFILE, name, &error);
-    SetLogs(success, error, pErrorLog, pSuccessLog);
-    return NS_ERROR_FAILURE;
-  }
-
-#ifdef IMPORT_DEBUG
-  nsCString pPath;
-  inFile->GetNativePath(pPath);
-  IMPORT_LOG1("Import mailbox: %s\n", pPath.get());
-#endif
-
-
-  int32_t  msgCount = 0;
-  nsresult rv = NS_OK;
-
-  m_bytes = 0;
-  rv = m_eudora.ImportMailbox( &m_bytes, &abort, name.get(), inFile, pDstFolder, &msgCount);
-  if (NS_SUCCEEDED(rv))
-    ReportSuccess(name, msgCount, &success);
-  else
-    ReportError(EUDORAIMPORT_MAILBOX_CONVERTERROR, name, &error);
-
-  SetLogs(success, error, pErrorLog, pSuccessLog);
-
-  IMPORT_LOG0("*** Returning from eudora mailbox import\n");
-
-  return rv;
-}
-
-
-NS_IMETHODIMP ImportEudoraMailImpl::GetImportProgress(uint32_t *pDoneSoFar)
-{
-  NS_PRECONDITION(pDoneSoFar != nullptr, "null ptr");
-  if (! pDoneSoFar)
-    return NS_ERROR_NULL_POINTER;
-
-  *pDoneSoFar = m_bytes;
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP ImportEudoraMailImpl::TranslateFolderName(const nsAString & aFolderName, nsAString & _retval)
-{
-  if (aFolderName.LowerCaseEqualsLiteral("out"))
-    _retval = NS_LITERAL_STRING(kDestSentFolderName);
-  else if (aFolderName.LowerCaseEqualsLiteral("in"))
-    _retval = NS_LITERAL_STRING(kDestInboxFolderName);
-  else
-    _retval = aFolderName;
-  return NS_OK;
-}
-
-nsresult ImportEudoraAddressImpl::Create(nsIImportAddressBooks** aImport)
-{
-  NS_PRECONDITION(aImport != nullptr, "null ptr");
-  if (! aImport)
-    return NS_ERROR_NULL_POINTER;
-
-  *aImport = new ImportEudoraAddressImpl();
-  if (! *aImport)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  NS_ADDREF(*aImport);
-  return NS_OK;
-}
-
-ImportEudoraAddressImpl::ImportEudoraAddressImpl()
-{
-}
-
-
-ImportEudoraAddressImpl::~ImportEudoraAddressImpl()
-{
-}
-
-
-
-NS_IMPL_ISUPPORTS(ImportEudoraAddressImpl, nsIImportAddressBooks)
-
-
-NS_IMETHODIMP ImportEudoraAddressImpl::GetAutoFind(char16_t **description, bool *_retval)
-{
-  NS_PRECONDITION(description != nullptr, "null ptr");
-  NS_PRECONDITION(_retval != nullptr, "null ptr");
-  if (! description || !_retval)
-    return NS_ERROR_NULL_POINTER;
-
-  nsString  str;
-  *_retval = false;
-  nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_NICKNAMES_NAME, str);
-  *description = ToNewUnicode(str);
-
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP ImportEudoraAddressImpl::GetDefaultLocation(nsIFile **ppLoc, bool *found, bool *userVerify)
-{
-  NS_PRECONDITION(found != nullptr, "null ptr");
-  NS_PRECONDITION(ppLoc != nullptr, "null ptr");
-  NS_PRECONDITION(userVerify != nullptr, "null ptr");
-  if (! found || !userVerify || !ppLoc)
-    return NS_ERROR_NULL_POINTER;
-
-  *ppLoc = nullptr;
-  *found = m_eudora.FindAddressFolder(ppLoc);
-  *userVerify = true;
-
-  return NS_OK;
-}
-
-
-
-NS_IMETHODIMP ImportEudoraAddressImpl::FindAddressBooks(nsIFile *pLoc, nsIArray **ppArray)
-{
-    NS_PRECONDITION(pLoc != nullptr, "null ptr");
-    NS_PRECONDITION(ppArray != nullptr, "null ptr");
-    if (!pLoc || !ppArray)
-        return NS_ERROR_NULL_POINTER;
-
-  bool exists = false;
-  nsresult rv = pLoc->Exists(&exists);
-  if (NS_FAILED(rv) || !exists)
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
-  if (NS_FAILED(rv))
-  {
-    IMPORT_LOG0("FAILED to allocate the nsIMutableArray\n");
-    return rv;
-  }
-  rv = m_eudora.FindAddressBooks(pLoc, array);
-  if (NS_FAILED(rv))
-    return rv;
-
-  array.forget(ppArray);
-
-  return NS_OK;
-}
-
-
-
-void ImportEudoraAddressImpl::ReportSuccess(nsString& name, nsString *pStream)
-{
-  if (!pStream)
-    return;
-  // load the success string
-  char16_t *pFmt = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_ADDRESS_SUCCESS);
-  char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get());
-  pStream->Append(pText);
-  nsTextFormatter::smprintf_free(pText);
-  nsEudoraStringBundle::FreeString(pFmt);
-  ImportEudoraMailImpl::AddLinebreak(pStream);
-}
-
-
-NS_IMETHODIMP
-ImportEudoraAddressImpl::ImportAddressBook(nsIImportABDescriptor *pSource,
-                                           nsIAddrDatabase *pDestination,
-                                           nsIImportFieldMap *fieldMap,
-                                           nsISupports *aSupportService,
-                                           char16_t **pErrorLog,
-                                           char16_t **pSuccessLog,
-                                           bool *fatalError)
-{
-  NS_PRECONDITION(pSource != nullptr, "null ptr");
-  NS_PRECONDITION(pDestination != nullptr, "null ptr");
-  NS_PRECONDITION(fatalError != nullptr, "null ptr");
-
-  nsString success;
-  nsString error;
-  if (!pSource || !pDestination || !fatalError) {
-    IMPORT_LOG0("*** Bad param passed to eudora address import\n");
-    nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_ADDRESS_BADPARAM, error);
-    if (fatalError)
-      *fatalError = true;
-    ImportEudoraMailImpl::SetLogs(success, error, pErrorLog, pSuccessLog);
-    return NS_ERROR_NULL_POINTER;
-  }
-
-  bool abort = false;
-  nsString name;
-  pSource->GetPreferredName(name);
-
-  uint32_t addressSize = 0;
-  pSource->GetSize(&addressSize);
-  if (addressSize == 0) {
-    IMPORT_LOG0("Address book size is 0, skipping mailbox.\n");
-    ReportSuccess(name, &success);
-    ImportEudoraMailImpl::SetLogs(success, error, pErrorLog, pSuccessLog);
-    return NS_OK;
-  }
-
-
-  nsCOMPtr<nsIFile> inFile;
-  if (NS_FAILED(pSource->GetAbFile(getter_AddRefs(inFile)))) {
-    ImportEudoraMailImpl::ReportError(EUDORAIMPORT_ADDRESS_BADSOURCEFILE, name, &error);
-    ImportEudoraMailImpl::SetLogs(success, error, pErrorLog, pSuccessLog);
-    return NS_ERROR_FAILURE;
-  }
-
-
-#ifdef IMPORT_DEBUG
-  nsCString path;
-  inFile->GetNativePath(path);
-  IMPORT_LOG1("Import address book: %s\n", path.get());
-#endif
-
-
-  nsresult rv = NS_OK;
-
-  m_bytes = 0;
-  rv = m_eudora.ImportAddresses(&m_bytes, &abort, name.get(), inFile, pDestination, error);
-
-  if (NS_SUCCEEDED(rv) && error.IsEmpty())
-    ReportSuccess(name, &success);
-  else
-    ImportEudoraMailImpl::ReportError(EUDORAIMPORT_ADDRESS_CONVERTERROR, name, &error);
-
-  ImportEudoraMailImpl::SetLogs(success, error, pErrorLog, pSuccessLog);
-
-  IMPORT_LOG0("*** Returning from eudora address import\n");
-
-  return rv;
-}
-
-
-NS_IMETHODIMP ImportEudoraAddressImpl::GetImportProgress(uint32_t *_retval)
-{
-  NS_PRECONDITION(_retval != nullptr, "null ptr");
-  if (!_retval)
-    return NS_ERROR_NULL_POINTER;
-
-  *_retval = m_bytes;
-
-  return NS_OK;
-}
-
-
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraImport.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsEudoraImport_h___
-#define nsEudoraImport_h___
-
-#include "nsIImportModule.h"
-#include "nsCOMPtr.h"
-
-
-#define NS_EUDORAIMPORT_CID          \
-{ /* c8448da0-8f83-11d3-a206-00a0cc26da63 */      \
-  0xc8448da0, 0x8f83, 0x11d3,            \
-  {0xa2, 0x6, 0x0, 0xa0, 0xcc, 0x26, 0xda, 0x63 }}
-
-
-
-
-#define kEudoraSupportsString NS_IMPORT_MAIL_STR "," NS_IMPORT_ADDRESS_STR "," NS_IMPORT_SETTINGS_STR "," NS_IMPORT_FILTERS_STR
-
-class nsEudoraImport : public nsIImportModule
-{
-public:
-
-  nsEudoraImport();
-
-  NS_DECL_ISUPPORTS
-
-  ////////////////////////////////////////////////////////////////////////////////////////
-  // we suppport the nsIImportModule interface
-  ////////////////////////////////////////////////////////////////////////////////////////
-
-  NS_DECL_NSIIMPORTMODULE
-
-
-protected:
-  virtual ~nsEudoraImport();
-};
-
-
-#endif /* nsEudoraImport_h___ */
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraMac.cpp
+++ /dev/null
@@ -1,1221 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsCOMPtr.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
-#include "nsIMsgAccountManager.h"
-#include "nsIMsgAccount.h"
-#include "nsIMutableArray.h"
-#include "nsMsgBaseCID.h"
-#include "nsMsgCompCID.h"
-#include "nsISmtpService.h"
-#include "nsISmtpServer.h"
-#include "nsEudoraMac.h"
-#include "nsIImportService.h"
-#include "nsIImportMailboxDescriptor.h"
-#include "nsIImportABDescriptor.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsEudoraStringBundle.h"
-#include "nsEudoraImport.h"
-#include "nsIPop3IncomingServer.h"
-#include "nsUnicharUtils.h"
-#include "nsNetUtil.h"
-#include "EudoraDebugLog.h"
-
-#include "nsILocalFileMac.h"
-#include "nsIOutputStream.h"
-
-static NS_DEFINE_IID(kISupportsIID,      NS_ISUPPORTS_IID);
-
-static const char *  kWhitespace = "\b\t\r\n ";
-
-nsEudoraMac::nsEudoraMac()
-{
-}
-
-nsEudoraMac::~nsEudoraMac()
-{
-}
-
-bool nsEudoraMac::FindMailFolder(nsIFile **pFolder)
-{
-  return FindEudoraLocation(pFolder);
-}
-
-bool nsEudoraMac::FindEudoraLocation(nsIFile **pFolder, bool findIni, nsIFile *pLookIn)
-{
-  bool result = false;
-  // Modern versions of Eudora make the Eudora Folder in ~/Documents
-  // The last versions that ran MacOS Classic made the Eudora folder in the user's documents folder
-  // Early versions made the Eudora Folder in the System Folder
-  // Eudora searches those three locations, earliest first (System Folder:Eudora Folder), and uses the first Eudora Folder
-  // it finds.  However, it's not clear that any version of OSX can actually *find* the Classic "Documents" folder,
-  // even if there was one before the machine was updated to OSX.
-  // The name "Eudora Folder" should not be localized.  Early localized versions of Eudora did localize the name; later
-  // localized versions looked for the localized name and changed it back.  We will therefore not
-  // worry about the folder name being localized.  Japan may be an issue, though.
-  // SD 11/2006
-
-  if (!pLookIn)
-  {
-    result = FindEudoraLocation(pFolder, findIni, NS_OS_SYSTEM_DIR);
-    if (!result)
-    {
-      result = FindEudoraLocation(pFolder, findIni, NS_MAC_DOCUMENTS_DIR);
-      if (!result)
-        result = FindEudoraLocation(pFolder, findIni, NS_OSX_USER_DOCUMENTS_DIR);
-    }
-  }
-  else
-  {
-    *pFolder = pLookIn;
-    result = VerifyEudoraLocation(pFolder, findIni);
-  }
-
-  return result;
-}
-
-bool nsEudoraMac::FindEudoraLocation(nsIFile **pFolder, bool findIni, const char *specialDirName)
-{
-  nsCOMPtr <nsIFile> searchDir;
-  nsresult rv = NS_GetSpecialDirectory(specialDirName, getter_AddRefs(searchDir));
-  if (NS_FAILED(rv))
-    return false;
-
-  // Turn it into a mac file, so we can resolve aliases
-  nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(searchDir);
-  if (!macFile)
-    return false;
-  macFile->SetFollowLinks(true);
-
-  // It's always called "Eudora Folder", so add that to the path
-  macFile->AppendNative(NS_LITERAL_CSTRING("Eudora Folder" ));
-
-  // If it's an alias, the "target" will be the real file.  Fetch this as a string
-  // and set is back as the file
-  nsCString path;
-  macFile->GetNativeTarget(path);
-  macFile->InitWithNativePath(path);
-
-  // Resolve any unix-style symlinks (this won't do MacOS aliases, hence the machinations above)
-  bool link = false;
-  rv = searchDir->IsSymlink(&link);
-  if (NS_SUCCEEDED(rv) && link)
-  {
-    rv = macFile->SetFollowLinks(true);
-    if (NS_FAILED(rv))
-      return false;
-  }
-
-  // Check for existence and directoriness
-  bool exists = false;
-  rv = searchDir->Exists(&exists);
-  bool isFolder = false;
-  if (NS_SUCCEEDED(rv) && exists)
-    rv = searchDir->IsDirectory(&isFolder);
-  if (!exists || !isFolder)
-    return false;
-
-  NS_IF_ADDREF(*pFolder = searchDir);
-
-  return true;
-}
-
-bool nsEudoraMac::VerifyEudoraLocation(nsIFile **pFolder, bool findIni)
-{
-  bool result = false;
-  bool foundPref = false;
-
-
-  bool hasMore;
-  nsCOMPtr<nsISimpleEnumerator> directoryEnumerator;
-  nsresult rv = (*pFolder)->GetDirectoryEntries(getter_AddRefs(directoryEnumerator));
-  NS_ENSURE_SUCCESS(rv, false);
-
-  directoryEnumerator->HasMoreElements(&hasMore);
-  nsCOMPtr <nsIFile> prefFile;
-
-  int count = 0;
-  OSType type, creator;
-  while (hasMore && NS_SUCCEEDED(rv) && count < 2)
-  {
-    nsCOMPtr<nsISupports> aSupport;
-    rv = directoryEnumerator->GetNext(getter_AddRefs(aSupport));
-    nsCOMPtr<nsIFile> entry(do_QueryInterface(aSupport, &rv));
-    directoryEnumerator->HasMoreElements(&hasMore);
-
-
-    // find a file with TEXT, CSOm that isn't the nicknames file
-    // or just cheat and look for more than 1 file?
-    {
-      nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(entry, &rv);
-      if (NS_SUCCEEDED(rv))
-      {
-        macFile->GetFileCreator(&creator);
-        macFile->GetFileType(&type);
-      }
-    }
-    if (NS_SUCCEEDED(rv))
-    {
-      if ((type == 'TEXT') && (creator == 'CSOm'))
-        count++;
-      else if ((type == 'PREF') && (creator == 'CSOm'))
-      {
-        if (!foundPref)
-        {
-          prefFile = entry;
-          foundPref = true;
-        }
-        else
-        {
-          // does one of them end in ".bkup"?
-          nsCString leafName;
-          entry->GetNativeLeafName(leafName);
-          bool isBk = false;
-          isBk = StringEndsWith(leafName, NS_LITERAL_CSTRING(".bkup"));
-          if (!isBk)
-          {
-            prefFile->GetNativeLeafName(leafName);
-            isBk = StringEndsWith(leafName, NS_LITERAL_CSTRING(".bkup"));
-            if (isBk)
-              prefFile = entry;
-            else
-            {
-              // Neither of the pref files was named .bkup
-              // Pick the newest one?
-              int64_t modDate1, modDate2;
-
-              entry->GetLastModifiedTime(&modDate2);
-              prefFile->GetLastModifiedTime(&modDate1);
-              if (modDate2 > modDate1)
-                prefFile = entry;
-            }
-          }
-        }
-      }
-    }
-  }
-  if (count >= 2)
-    result = true;
-
-  if (!findIni)
-    return result;
-
-  if (!foundPref)
-    return false;
-
-  NS_IF_ADDREF(*pFolder = prefFile);
-
-  return true;
-}
-
-
-nsresult nsEudoraMac::FindMailboxes(nsIFile *pRoot, nsIMutableArray *pArray)
-{
-  nsresult rv;
-  nsCOMPtr<nsIImportService> impSvc(do_GetService(NS_IMPORTSERVICE_CONTRACTID, &rv));
-  if (NS_FAILED(rv))
-    return rv;
-
-  m_depth = 0;
-  m_mailImportLocation = do_QueryInterface(pRoot);
-
-  return ScanMailDir(pRoot, pArray, impSvc);
-}
-
-
-nsresult nsEudoraMac::ScanMailDir(nsIFile *pFolder, nsIMutableArray *pArray, nsIImportService *pImport)
-{
-
-  // On Windows, we look for a descmap file but on Mac we just iterate
-  // the directory
-
-  m_depth++;
-
-  nsresult rv = IterateMailDir(pFolder, pArray, pImport);
-
-  m_depth--;
-
-  return rv;
-}
-
-nsresult nsEudoraMac::IterateMailDir(nsIFile *pFolder, nsIMutableArray *pArray, nsIImportService *pImport)
-{
-  bool hasMore;
-  nsCOMPtr<nsISimpleEnumerator> directoryEnumerator;
-  nsresult rv = pFolder->GetDirectoryEntries(getter_AddRefs(directoryEnumerator));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  directoryEnumerator->HasMoreElements(&hasMore);
-
-  while (hasMore && NS_SUCCEEDED(rv))
-  {
-    nsCOMPtr<nsISupports> aSupport;
-    rv = directoryEnumerator->GetNext(getter_AddRefs(aSupport));
-    nsCOMPtr<nsIFile> entry(do_QueryInterface(aSupport, &rv));
-    directoryEnumerator->HasMoreElements(&hasMore);
-
-    bool isFolder;
-    bool isFile;
-    nsCString fName;
-    nsCString ext;
-    nsCString name;
-    OSType type;
-    OSType creator;
-
-    isFolder = false;
-    isFile = false;
-    rv = entry->IsDirectory(&isFolder);
-    rv = entry->IsFile(&isFile);
-    rv = entry->GetNativeLeafName(fName);
-    if (NS_SUCCEEDED(rv) && !fName.IsEmpty())
-    {
-      if (isFolder)
-      {
-        if (IsValidMailFolderName(fName))
-        {
-          rv = FoundMailFolder(entry, fName.get(), pArray, pImport);
-          if (NS_SUCCEEDED(rv))
-          {
-            rv = ScanMailDir(entry, pArray, pImport);
-            if (NS_FAILED(rv))
-              IMPORT_LOG0("*** Error scanning mail directory\n");
-          }
-        }
-      }
-      else if (isFile)
-      {
-        type = 0;
-        creator = 0;
-        {
-          nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(entry, &rv);
-          if (NS_SUCCEEDED(rv))
-          {
-            macFile->GetFileCreator(&creator);
-            macFile->GetFileType(&type);
-          }
-        }
-        if ((type == 'TEXT') && IsValidMailboxName(fName) && IsValidMailboxFile(entry))
-          rv = FoundMailbox(entry, fName.get(), pArray, pImport);
-      }
-    }
-  }
-  return rv;
-}
-
-
-nsresult nsEudoraMac::FoundMailbox(nsIFile *mailFile, const char *pName, nsIMutableArray *pArray, nsIImportService *pImport)
-{
-  nsAutoString              displayName;
-  nsCOMPtr<nsIImportMailboxDescriptor>  desc;
-  nsISupports *              pInterface;
-
-  NS_CopyNativeToUnicode(nsDependentCString(pName), displayName);
-
-#ifdef IMPORT_DEBUG
-  nsCString path;
-  mailFile->GetNativePath(path);
-  if (!path.IsEmpty())
-    IMPORT_LOG2("Found eudora mailbox, %s: %s\n", path.get(), pName);
-  else
-    IMPORT_LOG1("Found eudora mailbox, %s\n", pName);
-  IMPORT_LOG1("\tm_depth = %d\n", (int)m_depth);
-#endif
-
-  nsresult rv = pImport->CreateNewMailboxDescriptor(getter_AddRefs(desc));
-  if (NS_SUCCEEDED(rv))
-  {
-    int64_t    sz = 0;
-    mailFile->GetFileSize(&sz);
-    desc->SetDisplayName(displayName.get());
-    desc->SetDepth(m_depth);
-    nsCOMPtr <nsIFile> pLocalFile;
-    desc->GetFile(getter_AddRefs(pLocalFile));
-    if (pLocalFile)
-    {
-      pLocalFile->InitWithFile(mailFile);
-    }
-    rv = desc->QueryInterface(kISupportsIID, (void **) &pInterface);
-    pArray->AppendElement(pInterface, false);
-    pInterface->Release();
-  }
-
-  return NS_OK;
-}
-
-
-nsresult nsEudoraMac::FoundMailFolder(nsIFile *mailFolder, const char *pName, nsIMutableArray *pArray, nsIImportService *pImport)
-{
-  nsAutoString          displayName;
-  nsCOMPtr<nsIImportMailboxDescriptor>  desc;
-  nsISupports *              pInterface;
-
-  NS_CopyNativeToUnicode(nsDependentCString(pName), displayName);
-
-#ifdef IMPORT_DEBUG
-  nsCString path;
-  mailFolder->GetNativePath(path);
-  if (!path.IsEmpty())
-    IMPORT_LOG2("Found eudora folder, %s: %s\n",path.get(), pName);
-  else
-    IMPORT_LOG1("Found eudora folder, %s\n", pName);
-  IMPORT_LOG1("\tm_depth = %d\n", (int)m_depth);
-#endif
-
-  nsresult rv = pImport->CreateNewMailboxDescriptor(getter_AddRefs(desc));
-  if (NS_SUCCEEDED(rv))
-  {
-    int64_t    sz = 0;
-    desc->SetDisplayName(displayName.get());
-    desc->SetDepth(m_depth);
-    desc->SetSize(sz);
-    nsCOMPtr <nsIFile> pFile;
-    desc->GetFile(getter_AddRefs(pFile));
-    if (pFile)
-      pFile->InitWithFile(mailFolder);
-    rv = desc->QueryInterface(kISupportsIID, (void **) &pInterface);
-    pArray->AppendElement(pInterface, false);
-    pInterface->Release();
-  }
-
-  return NS_OK;
-}
-
-bool nsEudoraMac::CreateTocFromResource(nsIFile *pMail, nsIFile **pToc)
-{
-  ResFileRefNum resFile = -1;
-
-  {
-    nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(pMail);
-
-    FSRef fsRef;
-    nsresult rv = macFile->GetFSRef(&fsRef);
-    if (NS_FAILED(rv))
-      return false;
-
-    resFile = FSOpenResFile(&fsRef, fsRdPerm);
-  }
-
-  if (resFile == -1)
-    return false;
-  Handle  resH = nil;
-  short max = Count1Resources('TOCF');
-  if (max)
-    resH = Get1IndResource('TOCF', 1);
-  bool     result = false;
-  if (resH)
-  {
-    int32_t sz = (int32_t) GetHandleSize(resH);
-    if (sz)
-    {
-      // Create the new TOC file
-      nsCOMPtr<nsIFile> tempDir;
-      nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tempDir));
-      if (NS_FAILED(rv))
-        return false;
-
-      nsCOMPtr <nsIOutputStream> outputStream;
-        rv = tempDir->Clone(pToc);
-      if (NS_SUCCEEDED(rv))
-        rv = (*pToc)->AppendNative(NS_LITERAL_CSTRING("temp.toc"));
-      if (NS_SUCCEEDED(rv))
-        rv = (*pToc)->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 00600);
-      if (NS_SUCCEEDED(rv))
-        rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream), (*pToc));
-      if (NS_SUCCEEDED(rv))
-      {
-        HLock(resH);
-        uint32_t written = 0;
-        rv = outputStream->Write(*resH, sz, &written);
-        HUnlock(resH);
-        outputStream->Close();
-        if (NS_FAILED(rv) || (written != sz))
-          (*pToc)->Remove(false);
-        else
-          result = true;
-      }
-    }
-    ReleaseResource(resH);
-  }
-  CloseResFile(resFile);
-
-  return result;
-}
-
-
-nsresult nsEudoraMac::FindTOCFile(nsIFile *pMailFile, nsIFile **ppTOCFile, bool *pDeleteToc)
-{
-  nsresult    rv;
-
-  *pDeleteToc = false;
-  *ppTOCFile = nullptr;
-  nsCString leaf;
-  rv = pMailFile->GetNativeLeafName(leaf);
-  if (NS_FAILED(rv))
-    return rv;
-  rv = pMailFile->GetParent(ppTOCFile);
-  if (NS_FAILED(rv))
-    return rv;
-
-  leaf.Append(".toc");
-
-  OSType  type = 0;
-  OSType  creator = 0;
-  bool    exists = false;
-  bool    isFile = false;
-  rv = (*ppTOCFile)->AppendNative(leaf);
-  if (NS_SUCCEEDED(rv))
-    rv = (*ppTOCFile)->Exists(&exists);
-  if (NS_SUCCEEDED(rv) && exists)
-    rv = (*ppTOCFile)->IsFile(&isFile);
-  if (isFile)
-  {
-    nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(*ppTOCFile);
-    if (macFile)
-    {
-      macFile->GetFileCreator(&creator);
-      macFile->GetFileType(&type);
-    }
-  }
-
-
-  if (exists && isFile && (type == 'TOCF') && (creator == 'CSOm'))
-    return NS_OK;
-
-  // try and create the file from a resource.
-  if (CreateTocFromResource(pMailFile, ppTOCFile))
-  {
-    *pDeleteToc = true;
-    return NS_OK;
-  }
-  return NS_ERROR_FAILURE;
-}
-
-// GetIndString isn't supported on 64-bit Mac OS X
-// This code is emulation for GetIndString.
-static StringPtr GetStringFromHandle(Handle aResource,
-                                     ResourceIndex aId)
-{
-  if (!aResource)
-    return nullptr;
-
-  uint8_t *data = *(uint8_t**)aResource;
-  uint16_t count = *(uint16_t*)data;
-#if defined(IS_LITTLE_ENDIAN)
-  count = count << 8 | count >> 8;
-#endif
-
-  // First 2 bytes are the count of string that this resource has.
-  if (count < aId)
-    return nullptr;
-
-  // skip count
-  data += 2;
-
-  // looking for data.  data is in order
-  while (--aId > 0)
-    data = data + (*(uint8_t*)data) + 1;
-
-  return data;
-}
-
-// Strings returned:
-//  1 - smtp server
-//  2 - pop account user name
-//  3 - the pop server
-//  4 - Return address
-//  5 - Full name
-//  6 - Leave mail on server
-#define kNumSettingStrs     6
-#define kSmtpServerStr      0
-#define kPopAccountNameStr  1
-#define kPopServerStr       2
-#define kReturnAddressStr   3
-#define kFullNameStr        4
-#define kLeaveOnServerStr   5
-
-// resource IDs
-#define kSmtpServerID         4
-#define kEmailAddressID       3
-#define kReturnAddressID      5
-#define kFullNameID           77
-#define kLeaveMailOnServerID  18
-
-
-bool nsEudoraMac::GetSettingsFromResource(nsIFile *pSettings, short resId, nsCString **pStrs, bool *pIMAP)
-{
-  nsresult rv;
-  *pIMAP = false;
-  // Get settings from the resources...
-  ResFileRefNum resFile = -1;
-  {
-    nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(pSettings, &rv);
-    if (NS_FAILED(rv))
-      return false;
-
-    FSRef fsRef;
-    rv = macFile->GetFSRef(&fsRef);
-    if (NS_FAILED(rv))
-      return false;
-
-    resFile = FSOpenResFile(&fsRef, fsRdPerm);
-  }
-  if (resFile == -1)
-    return false;
-
-  UseResFile(resFile);
-
-  // smtp server, STR# 1000, 4
-  Handle  resH = Get1Resource('STR#', resId /* 1000 */);
-  int    idx;
-  if (resH)
-  {
-    StringPtr  pStr[5];
-    StringPtr   theStr;
-
-    // Cannot use GetIndString due to 64-bit support
-    pStr[0] = GetStringFromHandle(resH, kSmtpServerID);
-    pStr[1] = GetStringFromHandle(resH, kEmailAddressID);
-    pStr[2] = GetStringFromHandle(resH, kReturnAddressID);
-    pStr[3] = GetStringFromHandle(resH, kFullNameID);
-    pStr[4] = GetStringFromHandle(resH, kLeaveMailOnServerID);
-
-    theStr = pStr[0];
-    if (theStr && *theStr)
-      pStrs[0]->Append((const char *) (theStr + 1), *theStr);
-    theStr = pStr[1];
-    if (theStr && *theStr)
-    {
-      idx = 1;
-      while (idx <= *theStr)
-      {
-        if (theStr[idx] == '@')
-          break;
-        else
-          idx++;
-      }
-      if (idx <= *theStr)
-      {
-        uint8_t  save = *theStr;
-        *theStr = idx - 1;
-        if (*theStr)
-          pStrs[1]->Append((const char *) (theStr + 1), *theStr);
-        *theStr = save;
-      }
-      else
-        idx = 0;
-      theStr[idx] = theStr[0] - idx;
-      if (theStr[idx])
-        pStrs[2]->Append((const char *) (theStr + idx + 1), *(theStr + idx));
-    }
-    theStr = pStr[2];
-    if (theStr && *theStr)
-      pStrs[3]->Append((const char *) (theStr + 1), *theStr);
-    theStr = pStr[3];
-    if (theStr && *theStr)
-      pStrs[4]->Append((const char *) (theStr + 1), *theStr);
-    theStr = pStr[4];
-    if (theStr && *theStr)
-    {
-      if (theStr[1] == 'y')
-        *(pStrs[5]) = "Y";
-      else
-        *(pStrs[5]) = "N";
-    }
-
-    ReleaseResource(resH);
-    CloseResFile(resFile);
-
-    return true;
-  }
-  else
-  {
-    CloseResFile(resFile);
-    return false;
-  }
-}
-
-bool nsEudoraMac::ImportSettings(nsIFile *pIniFile, nsIMsgAccount **localMailAccount)
-{
-  nsresult  rv;
-
-  nsCOMPtr<nsIMsgAccountManager> accMgr =
-           do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
-  if (NS_FAILED(rv))
-  {
-    IMPORT_LOG0("*** Failed to create a account manager!\n");
-    return false;
-  }
-
-  short  baseResId = 1000;
-  nsCString **pStrs = new nsCString *[kNumSettingStrs];
-  int    i;
-
-  for (i = 0; i < kNumSettingStrs; i++)
-    pStrs[i] = new nsCString;
-
-  nsString accName(NS_LITERAL_STRING("Eudora Settings"));
-  nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_ACCOUNTNAME, accName);
-
-  // This is a little overkill but we're not sure yet how multiple accounts
-  // are stored in the Mac preferences, hopefully similar to existing prefs
-  // which means the following is a good start!
-  bool    isIMAP = false;
-
-  int        popCount = 0;
-  int        accounts = 0;
-  nsIMsgAccount *  pAccount;
-
-  while (baseResId)
-  {
-    isIMAP = false;
-    if (GetSettingsFromResource(pIniFile, baseResId, pStrs, &isIMAP))
-    {
-      pAccount = nullptr;
-      if (!isIMAP)
-      {
-        // This is a POP account
-        if (BuildPOPAccount(accMgr, pStrs, &pAccount, accName))
-        {
-          accounts++;
-          popCount++;
-          if (popCount > 1)
-          {
-            if (localMailAccount && *localMailAccount)
-              NS_RELEASE(*localMailAccount);
-          }
-          else if (localMailAccount)
-          {
-            *localMailAccount = pAccount;
-            NS_IF_ADDREF(pAccount);
-          }
-        }
-      }
-      else
-      {
-        // This is an IMAP account
-        if (BuildIMAPAccount(accMgr, pStrs, &pAccount, accName))
-          accounts++;
-      }
-      if (pAccount && (baseResId == 1000))
-        accMgr->SetDefaultAccount(pAccount);
-
-      NS_IF_RELEASE(pAccount);
-    }
-
-    baseResId = 0;
-    // Set the next account name???
-
-    if (baseResId)
-    {
-      for (i = 0; i < kNumSettingStrs; i++)
-        pStrs[i]->Truncate();
-    }
-  }
-
-  // Now save the new acct info to pref file.
-  rv = accMgr->SaveAccountInfo();
-  NS_ASSERTION(NS_SUCCEEDED(rv), "Can't save account info to pref file");
-
-  for (i = 0; i < kNumSettingStrs; i++)
-    delete pStrs[i];
-  delete pStrs;
-
-  return accounts != 0;
-}
-
-bool nsEudoraMac::FindFiltersFile(nsIFile **pFiltersFile)
-{
-  bool result = FindEudoraLocation(pFiltersFile, false);
-
-  if (result)
-  {
-    (*pFiltersFile)->AppendNative(NS_LITERAL_CSTRING("Eudora Filters"));
-    (*pFiltersFile)->IsFile(&result);
-  }
-
-  return result;
-}
-
-
-
-bool nsEudoraMac::BuildPOPAccount(nsIMsgAccountManager *accMgr, nsCString **pStrs, nsIMsgAccount **ppAccount, nsString& accName)
-{
-  if (ppAccount)
-    *ppAccount = nullptr;
-
-
-  if (!pStrs[kPopServerStr]->Length() || !pStrs[kPopAccountNameStr]->Length())
-    return false;
-
-  bool    result = false;
-
-  // I now have a user name/server name pair, find out if it already exists?
-  nsCOMPtr<nsIMsgIncomingServer> in;
-  nsresult rv = accMgr->FindServer(*(pStrs[kPopAccountNameStr]), *(pStrs[kPopServerStr]), NS_LITERAL_CSTRING("pop3"), getter_AddRefs(in));
-  if (NS_FAILED(rv) || (in == nullptr))
-  {
-    // Create the incoming server and an account for it?
-    rv = accMgr->CreateIncomingServer(*(pStrs[kPopAccountNameStr]), *(pStrs[kPopServerStr]), NS_LITERAL_CSTRING("pop3"), getter_AddRefs(in));
-    if (NS_SUCCEEDED(rv) && in)
-    {
-      rv = in->SetType(NS_LITERAL_CSTRING("pop3"));
-      // rv = in->SetHostName(pStrs[kPopServerStr]->get());
-      // rv = in->SetUsername(pStrs[kPopAccountNameStr]->get());
-
-      IMPORT_LOG2("Created POP3 server named: %s, userName: %s\n", pStrs[kPopServerStr]->get(), pStrs[kPopAccountNameStr]->get());
-      IMPORT_LOG1("\tSet pretty name to: %S\n", accName.get());
-      rv = in->SetPrettyName(accName);
-
-      // We have a server, create an account.
-      nsCOMPtr<nsIMsgAccount>  account;
-      rv = accMgr->CreateAccount(getter_AddRefs(account));
-      if (NS_SUCCEEDED(rv) && account)
-      {
-        rv = account->SetIncomingServer(in);
-
-        IMPORT_LOG0("Created a new account and set the incoming server to the POP3 server.\n");
-
-        nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(in, &rv);
-        NS_ENSURE_SUCCESS(rv, false);
-        pop3Server->SetLeaveMessagesOnServer(pStrs[kLeaveOnServerStr]->First() == 'Y' ? true : false);
-
-        // Fiddle with the identities
-        SetIdentities(accMgr, account, pStrs[kPopAccountNameStr]->get(), pStrs[kPopServerStr]->get(), pStrs);
-        result = true;
-        if (ppAccount)
-          account->QueryInterface(NS_GET_IID(nsIMsgAccount), (void **)ppAccount);
-      }
-    }
-  }
-  else
-    result = true;
-
-  return result;
-}
-
-
-bool nsEudoraMac::BuildIMAPAccount(nsIMsgAccountManager *accMgr, nsCString **pStrs, nsIMsgAccount **ppAccount, nsString& accName)
-{
-  if (!pStrs[kPopServerStr]->Length() || !pStrs[kPopAccountNameStr]->Length())
-    return false;
-
-  bool result = false;
-
-  nsCOMPtr<nsIMsgIncomingServer>  in;
-  nsresult rv = accMgr->FindServer(*(pStrs[kPopAccountNameStr]), *(pStrs[kPopServerStr]), NS_LITERAL_CSTRING("imap"), getter_AddRefs(in));
-  if (NS_FAILED(rv) || (in == nullptr))
-  {
-    // Create the incoming server and an account for it?
-    rv = accMgr->CreateIncomingServer(*(pStrs[kPopAccountNameStr]), *(pStrs[kPopServerStr]), NS_LITERAL_CSTRING("imap"), getter_AddRefs(in));
-    if (NS_SUCCEEDED(rv) && in)
-    {
-      rv = in->SetType(NS_LITERAL_CSTRING("imap"));
-      // rv = in->SetHostName(pStrs[kPopServerStr]->get());
-      // rv = in->SetUsername(pStrs[kPopAccountNameStr]->get());
-
-      IMPORT_LOG2("Created IMAP server named: %s, userName: %s\n", pStrs[kPopServerStr]->get(), pStrs[kPopAccountNameStr]->get());
-      IMPORT_LOG1("\tSet pretty name to: %S\n", accName.get());
-      rv = in->SetPrettyName(accName);
-
-      // We have a server, create an account.
-      nsCOMPtr<nsIMsgAccount>  account;
-      rv = accMgr->CreateAccount(getter_AddRefs(account));
-      if (NS_SUCCEEDED(rv) && account)
-      {
-        rv = account->SetIncomingServer(in);
-
-        IMPORT_LOG0("Created an account and set the IMAP server as the incoming server\n");
-
-        // Fiddle with the identities
-        SetIdentities(accMgr, account, pStrs[kPopAccountNameStr]->get(), pStrs[kPopServerStr]->get(), pStrs);
-        result = true;
-        if (ppAccount)
-          account->QueryInterface(NS_GET_IID(nsIMsgAccount), (void **)ppAccount);
-      }
-    }
-  }
-  else
-    result = true;
-
-  return result;
-}
-
-
-void nsEudoraMac::SetIdentities(nsIMsgAccountManager *accMgr, nsIMsgAccount *acc, const char *userName, const char *serverName, nsCString **pStrs)
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIMsgIdentity> id;
-  rv = accMgr->CreateIdentity(getter_AddRefs(id));
-  if (id)
-  {
-    nsAutoString fullName;
-    if (pStrs[kFullNameStr]->Length())
-      CopyASCIItoUTF16(pStrs[kFullNameStr]->get(), fullName);
-    id->SetFullName(fullName);
-    id->SetIdentityName(fullName);
-    if (pStrs[kReturnAddressStr]->Length())
-      id->SetEmail(*(pStrs[kReturnAddressStr]));
-    else
-    {
-      nsAutoCString emailAddress;
-      emailAddress = userName;
-      emailAddress += "@";
-      emailAddress += serverName;
-      id->SetEmail(emailAddress);
-    }
-    acc->AddIdentity(id);
-    IMPORT_LOG0("Created identity and added to the account\n");
-    IMPORT_LOG1("\tname: %s\n", pStrs[kFullNameStr]->get());
-    IMPORT_LOG1("\temail: %s\n", pStrs[kReturnAddressStr]->get());
-  }
-
-  SetSmtpServer(accMgr, acc, pStrs[kSmtpServerStr]->get(), userName);
-}
-
-
-void nsEudoraMac::SetSmtpServer(nsIMsgAccountManager *pMgr, nsIMsgAccount *pAcc, const char *pServer, const char *pUser)
-{
-  nsresult  rv;
-
-  nsCOMPtr<nsISmtpService> smtpService(do_GetService(NS_SMTPSERVICE_CONTRACTID, &rv));
-  if (NS_SUCCEEDED(rv) && smtpService)
-  {
-    nsCOMPtr<nsISmtpServer>    foundServer;
-
-    rv = smtpService->FindServer(pUser, pServer, getter_AddRefs(foundServer));
-    if (NS_SUCCEEDED(rv) && foundServer)
-    {
-      IMPORT_LOG1("SMTP server already exists: %s\n", pServer);
-      return;
-    }
-    nsCOMPtr<nsISmtpServer>    smtpServer;
-
-    rv = smtpService->CreateServer(getter_AddRefs(smtpServer));
-    if (NS_SUCCEEDED(rv) && smtpServer)
-    {
-      smtpServer->SetHostname(nsDependentCString(pServer));
-      if (pUser)
-        smtpServer->SetUsername(nsDependentCString(pUser));
-
-      IMPORT_LOG1("Created new SMTP server: %s\n", pServer);
-    }
-  }
-}
-
-
-nsresult nsEudoraMac::GetAttachmentInfo(const char *pFileName, nsIFile *pFile, nsCString& mimeType, nsCString& aAttachment)
-{
-  mimeType.Truncate();
-
-  // Sample attachment line
-  // Internet:sandh.jpg (JPEG/JVWR) (0003C2E8)
-
-  OSType    type = '?\??\?';
-  OSType    creator = '?\??\?';
-  uint32_t  fNum = 0;
-
-  nsCString  str(pFileName);
-  if (str.Length() > 22)
-  {
-    // try and extract the mac file info from the attachment line
-    nsCString  fileNum;
-    nsCString  types;
-
-    str.Right(fileNum, 10);
-    if ((fileNum.CharAt(0) == '(') && (fileNum.CharAt(9) == ')'))
-    {
-      if (MsgIsHex(fileNum.get() + 1, 8))
-      {
-        fNum = MsgUnhex(fileNum.get() + 1, 8);
-        str.Left(fileNum, str.Length() - 10);
-        str = fileNum;
-        str.Trim(kWhitespace);
-        str.Right(types, 11);
-        if ((types.CharAt(0) == '(') && (types.CharAt(5) == '/') && (types.CharAt(10) == ')'))
-        {
-          type = ((uint32_t)types.CharAt(1)) << 24;
-          type |= ((uint32_t)types.CharAt(2)) << 16;
-          type |= types.CharAt(3) << 8;
-          type |= types.CharAt(4);
-          creator = ((uint32_t)types.CharAt(6)) << 24;
-          creator |= ((uint32_t)types.CharAt(7)) << 16;
-          creator |= types.CharAt(8) << 8;
-          creator |= types.CharAt(9);
-          str.Left(types, str.Length() - 11);
-          str = types;
-          str.Trim(kWhitespace);
-        }
-      }
-      else
-        fNum = 0;
-    }
-  }
-
-#ifdef IMPORT_DEBUG
-  nsCString  typeStr;
-  nsCString  creatStr;
-
-  creatStr.Append((const char *)&creator, 4);
-  typeStr.Append((const char *)&type, 4);
-  IMPORT_LOG3("\tAttachment type: %s, creator: %s, fileNum: %ld\n", typeStr.get(), creatStr.get(), fNum);
-  IMPORT_LOG1("\tAttachment file name: %s\n", str.get());
-#endif
-  FSRef  fsRef;
-  memset(&fsRef, 0, sizeof(fsRef));
-  {
-    nsresult rv;
-    rv = pFile->InitWithNativePath(str);
-    if (NS_FAILED(rv))
-    {
-      IMPORT_LOG0("\tfailed to set native path\n");
-      return rv;
-    }
-
-    pFile->GetNativeLeafName(aAttachment);
-
-    nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(pFile, &rv);
-    if (NS_FAILED(rv))
-    {
-      IMPORT_LOG0("\tfailed to get local mac file\n");
-      return rv;
-    }
-
-    rv = macFile->GetFSRef(&fsRef);
-    if (NS_FAILED(rv))
-    {
-      IMPORT_LOG0("\tfailed to get FSRef\n");
-      return rv;
-    }
-  }
-
-  if (HasResourceFork(&fsRef))
-    mimeType = "application/applefile";
-  else
-    mimeType = "application/octet-stream";
-
-  IMPORT_LOG1("\tMimeType: %s\n", mimeType.get());
-
-  return NS_OK;
-}
-
-bool nsEudoraMac::HasResourceFork(FSRef *fsRef)
-{
-  FSCatalogInfo catalogInfo;
-  OSErr err = FSGetCatalogInfo(fsRef,
-                               kFSCatInfoDataSizes + kFSCatInfoRsrcSizes,
-                               &catalogInfo, nullptr, nullptr, nullptr);
-  return (err == noErr && catalogInfo.rsrcLogicalSize != 0);
-}
-
-
-#define    kNumBadFolderNames    7
-const char *cBadFolderNames[kNumBadFolderNames] =
-{
-  "Attachments Folder",
-  "Eudora Items",
-  "Nicknames Folder",
-  "Parts Folder",
-  "Signature Folder",
-  "Spool Folder",
-  "Stationery Folder"
-};
-
-bool nsEudoraMac::IsValidMailFolderName(nsCString& name)
-{
-  if (m_depth > 1)
-    return true;
-
-  for (int i = 0; i < kNumBadFolderNames; i++)
-  {
-    if (name.Equals(cBadFolderNames[i], nsCaseInsensitiveCStringComparator()))
-      return false;
-  }
-
-  return true;
-}
-
-
-bool nsEudoraMac::IsValidMailboxName(nsCString& fName)
-{
-  if (m_depth > 1)
-    return true;
-  return !fName.LowerCaseEqualsLiteral("eudora nicknames");
-}
-
-
-bool nsEudoraMac::IsValidMailboxFile(nsIFile *pFile)
-{
-  int64_t  size = 0;
-  nsresult rv = pFile->GetFileSize(&size);
-  if (size)
-  {
-    if (size < 10)
-      return false;
-    nsCOMPtr <nsIInputStream> inputStream;
-    rv = NS_NewLocalFileInputStream(getter_AddRefs(inputStream), pFile);
-    if (NS_FAILED(rv))
-      return false;
-    uint32_t  read = 0;
-    char  buffer[6];
-    char *  pBuf = buffer;
-    rv = inputStream->Read(pBuf, 5, &read);
-    inputStream->Close();
-    if (NS_FAILED(rv) || (read != 5))
-      return false;
-    buffer[5] = 0;
-    if (strcmp(buffer, "From "))
-      return false;
-  }
-
-  return true;
-}
-
-
-
-
-bool nsEudoraMac::FindAddressFolder(nsIFile **pFolder)
-{
-  return FindEudoraLocation(pFolder);
-}
-
-nsresult nsEudoraMac::FindAddressBooks(nsIFile *pRoot, nsIMutableArray *pArray)
-{
-  // Look for the nicknames file in this folder and then
-  // additional files in the Nicknames folder
-  // Try and find the nickNames file
-  nsresult rv;
-  nsCOMPtr<nsIFile> file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-  rv = file->InitWithFile(pRoot);
-  if (NS_FAILED(rv))
-    return rv;
-
-  nsCOMPtr<nsIImportService> impSvc(do_GetService(NS_IMPORTSERVICE_CONTRACTID, &rv));
-  if (NS_FAILED(rv))
-    return rv;
-
-  nsString displayName;
-  nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_NICKNAMES_NAME, displayName);
-  int64_t  sz = 0;
-
-  // First find the Nicknames file itself
-  rv = file->AppendNative(NS_LITERAL_CSTRING("Eudora Nicknames"));
-  bool exists = false;
-  bool isFile = false;
-  if (NS_SUCCEEDED(rv))
-    rv = file->Exists(&exists);
-  if (NS_SUCCEEDED(rv) && exists)
-    rv = file->IsFile(&isFile);
-
-
-  nsCOMPtr<nsIImportABDescriptor>  desc;
-  nsISupports *pInterface;
-
-  if (exists && isFile)
-  {
-    rv = impSvc->CreateNewABDescriptor(getter_AddRefs(desc));
-    if (NS_SUCCEEDED(rv))
-    {
-      sz = 0;
-      file->GetFileSize(&sz);
-      desc->SetPreferredName(displayName);
-      desc->SetSize(sz);
-      // SetAbFile will clone the file we pass to it.
-      desc->SetAbFile(file);
-      rv = desc->QueryInterface(kISupportsIID, (void **) &pInterface);
-      pArray->AppendElement(pInterface, false);
-      pInterface->Release();
-    }
-    if (NS_FAILED(rv))
-    {
-      IMPORT_LOG0("*** Error creating address book descriptor for eudora nicknames\n");
-      return rv;
-    }
-  }
-
-  // Now try the directory of address books!
-  rv = file->InitWithFile(pRoot);
-  if (NS_SUCCEEDED(rv))
-    rv = file->AppendNative(NS_LITERAL_CSTRING("Nicknames Folder"));
-  exists = false;
-  bool    isDir = false;
-  if (NS_SUCCEEDED(rv))
-    rv = file->Exists(&exists);
-  if (NS_SUCCEEDED(rv) && exists)
-    rv = file->IsDirectory(&isDir);
-
-  if (!isDir)
-    return NS_OK;
-
-  bool hasMore;
-  nsCOMPtr<nsISimpleEnumerator> directoryEnumerator;
-   rv = file->GetDirectoryEntries(getter_AddRefs(directoryEnumerator));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  directoryEnumerator->HasMoreElements(&hasMore);
-
-  nsCString name;
-  OSType          type;
-  OSType          creator;
-
-  while (hasMore && NS_SUCCEEDED(rv))
-  {
-    nsCOMPtr<nsISupports> aSupport;
-    rv = directoryEnumerator->GetNext(getter_AddRefs(aSupport));
-    nsCOMPtr<nsIFile> entry(do_QueryInterface(aSupport, &rv));
-    directoryEnumerator->HasMoreElements(&hasMore);
-
-    if (NS_SUCCEEDED(rv))
-    {
-      isFile = false;
-      rv = entry->IsFile(&isFile);
-      rv = entry->GetLeafName(displayName);
-      if (NS_SUCCEEDED(rv) && !displayName.IsEmpty() && isFile)
-      {
-        if (NS_SUCCEEDED(rv))
-        {
-          type = 0;
-          creator = 0;
-          {
-            nsCOMPtr<nsILocalFileMac> macFile = do_QueryInterface(entry, &rv);
-            if (NS_SUCCEEDED(rv))
-            {
-              macFile->GetFileCreator(&creator);
-              macFile->GetFileType(&type);
-            }
-          }
-          if (type == 'TEXT')
-          {
-
-            rv = impSvc->CreateNewABDescriptor(getter_AddRefs(desc));
-            if (NS_SUCCEEDED(rv))
-            {
-              sz = 0;
-              entry->GetFileSize(&sz);
-              desc->SetPreferredName(displayName);
-              desc->SetSize(sz);
-              // SetAbFile will clone the file we pass to it.
-              desc->SetAbFile(entry);
-              rv = desc->QueryInterface(kISupportsIID, (void **) &pInterface);
-              pArray->AppendElement(pInterface, false);
-              pInterface->Release();
-            }
-            if (NS_FAILED(rv))
-            {
-              IMPORT_LOG0("*** Error creating address book descriptor for eudora address book\n");
-              return rv;
-            }
-          }
-        }
-      }
-    }
-  }
-  return rv;
-}
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraMac.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsEudoraMac_h__
-#define nsEudoraMac_h__
-
-#include "mozilla/Attributes.h"
-#include "nscore.h"
-#include "nsStringGlue.h"
-#include "nsIFile.h"
-#include "nsEudoraMailbox.h"
-#include "nsEudoraAddress.h"
-
-#include <CoreServices/CoreServices.h>
-
-class nsIImportService;
-class nsIMsgAccountManager;
-class nsIMsgAccount;
-class nsIMutableArray;
-
-
-class nsEudoraMac : public nsEudoraMailbox, public nsEudoraAddress {
-public:
-  nsEudoraMac();
-  ~nsEudoraMac();
-
-    // retrieve the mail folder
-  virtual bool      FindMailFolder(nsIFile **pFolder) override;
-    // get the list of mailboxes
-  virtual nsresult  FindMailboxes(nsIFile *pRoot,
-                                  nsIMutableArray *pArray) override;
-    // get a TOC file from a mailbox file
-  virtual nsresult  FindTOCFile(nsIFile *pMailFile,
-                                nsIFile **pTOCFile,
-                                bool *pDeleteToc) override;
-
-  virtual nsresult  GetAttachmentInfo(const char *pFileName,
-                                      nsIFile *pFile,
-                                      nsCString& mimeType,
-                                      nsCString& aAttachment) override;
-
-    // Address book stuff
-  virtual bool      FindAddressFolder(nsIFile **pFolder) override;
-    // get the list of mailboxes
-  virtual nsresult  FindAddressBooks(nsIFile *pRoot,
-                                     nsIMutableArray *pArray) override;
-
-    // import settings
-  static bool    ImportSettings(nsIFile *pIniFile,
-                                nsIMsgAccount **localMailAccount);
-  static bool    FindSettingsFile(nsIFile **pIniFile) { return FindEudoraLocation(pIniFile, true);}
-
-  static bool    FindFiltersFile(nsIFile **pFiltersFile);
-
-private:
-  static bool    FindEudoraLocation(nsIFile **pFolder,
-                                    bool findIni = false,
-                                    nsIFile *pLookIn = nullptr);
-  static bool    FindEudoraLocation(nsIFile **pFolder,
-                                    bool findIni,
-                                    const char *specialDirName);
-  static bool    VerifyEudoraLocation(nsIFile **pFolder, bool findIni);
-
-
-  nsresult  ScanMailDir(nsIFile *pFolder,
-                        nsIMutableArray *pArray,
-                        nsIImportService *pImport);
-  nsresult  IterateMailDir(nsIFile *pFolder,
-                           nsIMutableArray *pArray,
-                           nsIImportService *pImport);
-  nsresult  FoundMailFolder(nsIFile *mailFolder,
-                            const char *pName,
-                            nsIMutableArray *pArray,
-                            nsIImportService *pImport);
-  nsresult  FoundMailbox(nsIFile *mailFile,
-                         const char *pName,
-                         nsIMutableArray *pArray,
-                         nsIImportService *pImport);
-
-  bool      IsValidMailFolderName(nsCString& name);
-  bool      IsValidMailboxName(nsCString& fName);
-  bool      IsValidMailboxFile(nsIFile *pFile);
-
-  bool      CreateTocFromResource(nsIFile *pMail, nsIFile **pToc);
-
-
-
-    // Settings support
-  static bool    BuildPOPAccount(nsIMsgAccountManager *accMgr,
-                                 nsCString **pStrs,
-                                 nsIMsgAccount **ppAccount,
-                                 nsString& accName);
-  static bool    BuildIMAPAccount(nsIMsgAccountManager *accMgr,
-                                  nsCString **pStrs,
-                                  nsIMsgAccount **ppAccount,
-                                  nsString& accName);
-  static void    SetIdentities(nsIMsgAccountManager *accMgr,
-                               nsIMsgAccount *acc,
-                               const char *userName,
-                               const char *serverName,
-                               nsCString **pStrs);
-  static void    SetSmtpServer(nsIMsgAccountManager *pMgr,
-                               nsIMsgAccount *pAcc,
-                               const char *pServer,
-                               const char *pUser);
-  static bool    GetSettingsFromResource(nsIFile *pSettings,
-                                         short resId,
-                                         nsCString **pStrs,
-                                         bool *pIMAP);
-
-
-private:
-  uint32_t m_depth;
-  nsCOMPtr <nsIFile> m_mailImportLocation;
-  bool HasResourceFork(FSRef *fsRef);
-};
-
-
-#endif /* nsEudoraMac_h__ */
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraMailbox.cpp
+++ /dev/null
@@ -1,1365 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "msgCore.h"
-#include "nsCOMPtr.h"
-#include "nsEudoraMailbox.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsEudoraCompose.h"
-#include "nspr.h"
-#include "nsMsgMessageFlags.h"
-#include "nsMailHeaders.h"
-#include "nsMsgLocalFolderHdrs.h"
-#include "nsIMsgFolder.h"
-#include "nsIMsgHdr.h"
-#include "nsIMsgPluggableStore.h"
-#include "nsMsgUtils.h"
-#include "nsCRT.h"
-#include "nsNetUtil.h"
-#include "EudoraDebugLog.h"
-#include "nsISeekableStream.h"
-#include "nsIInputStream.h"
-#include "nsIOutputStream.h"
-
-#define  kCopyBufferSize    8192
-#define  kMailReadBufferSize  16384
-#define DATE_STR_LEN      64      // 64 bytes is plenty to hold the date header.
-
-#define  kWhitespace  " \t\b\r\n"
-
-const char *eudoraFromLine = "From - Mon Jan 1 00:00:00 1965\x0D\x0A";
-
-#ifdef IMPORT_DEBUG
-void DUMP_FILENAME(nsIFile *pFile, bool endLine);
-
-void DUMP_FILENAME(nsIFile *pFile, bool endLine)
-{
-  nsCString pPath;
-  if (pFile)
-    pFile->GetNativePath(pPath);
-  if (!pPath.IsEmpty())
-    IMPORT_LOG1("%s", pPath.get());
-  else
-    IMPORT_LOG0("Unknown");
-  if (endLine)
-    IMPORT_LOG0("\n");
-}
-
-// #define  DONT_DELETE_EUDORA_TEMP_FILES    1
-
-#else
-#define DUMP_FILENAME(x, y)
-#endif
-
-static const char *eudoraWeekDays[7] = {
-  "Mon",
-  "Tue",
-  "Wed",
-  "Thu",
-  "Fri",
-  "Sat",
-  "Sun"
-};
-
-static const char *eudoraMonths[12] = {
-  "Jan",
-  "Feb",
-  "Mar",
-  "Apr",
-  "May",
-  "Jun",
-  "Jul",
-  "Aug",
-  "Sep",
-  "Oct",
-  "Nov",
-  "Dec"
-};
-
-uint16_t EudoraTOCEntry::GetMozillaStatusFlags()
-{
-  // Return the mozilla equivalent of flags that Eudora supports.
-  uint16_t  flags = 0;
-
-#ifndef XP_MACOSX
-  switch (m_State)
-  {
-    case MS_UNREAD:
-      flags = 0;
-      break;
-
-    case MS_READ:
-      flags = nsMsgMessageFlags::Read;
-      break;
-
-    case MS_REPLIED:
-      flags = nsMsgMessageFlags::Read | nsMsgMessageFlags::Replied;
-      break;
-
-    case MS_FORWARDED:
-      flags = nsMsgMessageFlags::Read | nsMsgMessageFlags::Forwarded;
-      break;
-
-    case MS_REDIRECT:
-      // Redirect doesn't really mean forwarded, but forwarded
-      // seems to be the closest equivalent for now.
-      flags = nsMsgMessageFlags::Read | nsMsgMessageFlags::Forwarded;
-      break;
-
-    case MS_UNSENDABLE:
-    case MS_SENDABLE:
-    case MS_QUEUED:
-    case MS_SENT:
-    case MS_UNSENT:
-    case MS_TIME_QUEUED:
-    case MS_SPOOLED:
-      // To do: Add more sent message flag handling.
-      flags = 0;
-      break;
-
-    case MS_RECOVERED:
-      flags = nsMsgMessageFlags::Read;
-      break;
-  }
-
-  // Range check priority just to be sure
-  if (m_Priority < MSP_HIGHEST)
-    m_Priority = MSP_HIGHEST;
-  if (m_Priority > MSP_LOWEST)
-    m_Priority = MSP_LOWEST;
-
-  // Translate priority into format used in mozilla status flags
-  // (which is reversed for some reason)
-  flags |= (7-m_Priority) << 13;
-#endif
-
-  return flags;
-}
-
-uint32_t EudoraTOCEntry::GetMozillaStatus2Flags()
-{
-#ifdef XP_MACOSX
-  return 0;
-#else
-
-  // Return the mozilla equivalent of flags that Eudora supports.
-  uint32_t  flags = 0;
-
-  if (m_Imflags & IMFLAGS_DELETED)
-    flags |= nsMsgMessageFlags::IMAPDeleted;
-
-  if (m_Flags & MSF_READ_RECEIPT)
-    flags |= nsMsgMessageFlags::MDNReportNeeded;
-
-  return flags;
-#endif
-}
-
-nsEudoraMailbox::nsEudoraMailbox()
-: m_fromLen(0)
-{
-}
-
-nsEudoraMailbox::~nsEudoraMailbox()
-{
-  EmptyAttachments();
-}
-
-nsresult nsEudoraMailbox::CreateTempFile(nsIFile **ppFile)
-{
-  nsresult rv = GetSpecialDirectoryWithFileName(NS_OS_TEMP_DIR,
-                                                "impmail.txt",
-                                                ppFile);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return (*ppFile)->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 00600);
-}
-
-nsresult nsEudoraMailbox::DeleteFile(nsIFile *pFile)
-{
-  bool      result;
-  nsresult  rv = NS_OK;
-
-  result = false;
-  pFile->Exists(&result);
-  if (result) {
-    result = false;
-    pFile->IsFile(&result);
-    if (result) {
-#ifndef DONT_DELETE_EUDORA_TEMP_FILES
-        rv = pFile->Remove(false);
-#endif
-    }
-  }
-  return rv;
-}
-
-#define kComposeErrorStr  "X-Eudora-Compose-Error: *****" "\x0D\x0A"
-#define kHTMLTag "<html>"
-
-nsresult nsEudoraMailbox::ImportMailbox(uint32_t *pBytes, bool *pAbort,
-                                        const char16_t *pName, nsIFile *pSrc,
-                                        nsIMsgFolder *dstFolder,
-                                        int32_t *pMsgCount)
-{
-  nsCOMPtr<nsIFile>   tocFile;
-  nsCOMPtr<nsIInputStream> srcInputStream;
-  nsCOMPtr<nsIInputStream> tocInputStream;
-  nsCOMPtr<nsIOutputStream> mailOutputStream;
-  bool                importWithoutToc = true;
-  bool                deleteToc = false;
-  nsCOMPtr<nsIFile>   mailFile;
-
-  if (pMsgCount)
-    *pMsgCount = 0;
-
-  nsresult rv = pSrc->GetFileSize(&m_mailSize);
-
-  rv = NS_NewLocalFileInputStream(getter_AddRefs(srcInputStream), pSrc);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIFile> srcFile(pSrc);
-
-  // First, get the index file for this mailbox
-  rv = FindTOCFile(pSrc, getter_AddRefs(tocFile), &deleteToc);
-  if (NS_SUCCEEDED(rv) && tocFile)
-  {
-    IMPORT_LOG0("Reading euroda toc file: ");
-    DUMP_FILENAME(tocFile, true);
-
-    // Read the toc and import the messages
-    rv = ImportMailboxUsingTOC(pBytes, pAbort, srcInputStream, tocFile,
-                               dstFolder, pMsgCount);
-
-    // clean up
-    if (deleteToc)
-      DeleteFile(tocFile);
-
-    // If we were able to import with the TOC, then we don't need to bother
-    // importing without the TOC.
-    if (NS_SUCCEEDED(rv)) {
-      importWithoutToc = false;
-      IMPORT_LOG0("Imported mailbox: "); DUMP_FILENAME(pSrc, false);
-      IMPORT_LOG0("  Using TOC: "); DUMP_FILENAME(tocFile, true);
-    }
-    else {
-      IMPORT_LOG0("*** Error importing with TOC - will import without TOC.\n");
-    }
-  }
-
-  // pSrc must be Released before returning
-
-  if (importWithoutToc) {
-    // The source file contains partially constructed mail messages,
-    // and attachments.  We should first investigate if we can use the mailnews msgCompose
-    // stuff to do the work for us.  If not we have to scan the mailboxes and do TONS
-    // of work to properly reconstruct the message - Eudora is so nice that it strips things
-    // like MIME headers, character encoding, and attachments - beautiful!
-
-    rv = pSrc->GetFileSize(&m_mailSize);
-
-    SimpleBufferTonyRCopiedOnce    readBuffer;
-    SimpleBufferTonyRCopiedOnce    headers;
-    SimpleBufferTonyRCopiedOnce    body;
-    SimpleBufferTonyRCopiedOnce    copy;
-
-    headers.m_convertCRs = true;
-    body.m_convertCRs = true;
-
-    copy.Allocate(kCopyBufferSize);
-    readBuffer.Allocate(kMailReadBufferSize);
-    ReadFileState      state;
-    state.offset = 0;
-    state.size = m_mailSize;
-    state.pFile = pSrc;
-
-    IMPORT_LOG0("Reading mailbox\n");
-
-    if (NS_SUCCEEDED(rv))
-    {
-      nsCString defaultDate;
-      nsAutoCString bodyType;
-
-      IMPORT_LOG0("Reading first message\n");
-
-      nsCOMPtr<nsIOutputStream> outputStream;
-      nsCOMPtr<nsIMsgPluggableStore> msgStore;
-      rv = dstFolder->GetMsgStore(getter_AddRefs(msgStore));
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      while (!*pAbort && NS_SUCCEEDED(rv = ReadNextMessage( &state, readBuffer, headers, body, defaultDate, bodyType, NULL))) {
-
-        if (pBytes)
-          *pBytes += body.m_writeOffset - 1 + headers.m_writeOffset - 1;
-
-        nsCOMPtr<nsIMsgDBHdr> msgHdr;
-        bool reusable;
-
-        rv = msgStore->GetNewMsgOutputStream(dstFolder, getter_AddRefs(msgHdr), &reusable,
-                                             getter_AddRefs(outputStream));
-        if (NS_FAILED(rv))
-          break;
-
-        rv = ImportMessage(headers, body, defaultDate, bodyType, outputStream, pMsgCount);
-
-        if (NS_SUCCEEDED(rv))
-          msgStore->FinishNewMessage(outputStream, msgHdr);
-        else {
-          msgStore->DiscardNewMessage(outputStream, msgHdr);
-          IMPORT_LOG0( "*** Error importing message\n");
-        }
-
-        if (!reusable)
-          outputStream->Close();
-
-        if (!readBuffer.m_bytesInBuf && (state.offset >= state.size))
-          break;
-      }
-      if (outputStream)
-        outputStream->Close();
-    }
-    else {
-      IMPORT_LOG0("*** Error creating file spec for composition\n");
-    }
-  }
-  return rv;
-}
-
-#ifdef XP_MACOSX
-#define kMsgHeaderSize    220
-#define  kMsgFirstOffset    278
-#else
-#define  kMsgHeaderSize    218
-#define kMsgFirstOffset    104
-#endif
-
-nsresult nsEudoraMailbox::ImportMailboxUsingTOC(
-  uint32_t *pBytes,
-  bool *pAbort,
-  nsIInputStream *pInputStream,
-  nsIFile *tocFile,
-  nsIMsgFolder *dstFolder,
-  int32_t *pMsgCount)
-{
-  nsresult        rv = NS_OK;
-
-  int64_t  mailSize = m_mailSize;
-  int64_t  tocSize = 0;
-  uint32_t  saveBytes = pBytes ? *pBytes : 0;
-  nsCOMPtr <nsIInputStream> tocInputStream;
-
-  rv = tocFile->GetFileSize(&tocSize);
-
-  // if the index or the mail file is empty then just
-  // use the original mail file.
-  if (!mailSize || !tocSize)
-    return NS_ERROR_FAILURE;
-  rv = NS_NewLocalFileInputStream(getter_AddRefs(tocInputStream), tocFile);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  SimpleBufferTonyRCopiedOnce readBuffer;
-  SimpleBufferTonyRCopiedOnce headers;
-  SimpleBufferTonyRCopiedOnce body;
-  SimpleBufferTonyRCopiedOnce copy;
-  int32_t tocOffset = kMsgFirstOffset;
-  EudoraTOCEntry tocEntry;
-
-  copy.Allocate(kCopyBufferSize);
-  readBuffer.Allocate(kMailReadBufferSize);
-
-  IMPORT_LOG0("Importing mailbox using TOC: ");
-  DUMP_FILENAME(tocFile, true);
-
-  nsCOMPtr<nsISeekableStream> tocSeekableStream = do_QueryInterface(tocInputStream);
-  nsCOMPtr<nsISeekableStream> mailboxSeekableStream = do_QueryInterface(pInputStream);
-  nsCOMPtr<nsIOutputStream> outputStream;
-  nsCOMPtr<nsIMsgPluggableStore> msgStore;
-
-  rv = dstFolder->GetMsgStore(getter_AddRefs(msgStore));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  while (!*pAbort && (tocOffset < (int32_t)tocSize)) {
-    if (NS_FAILED(rv = tocSeekableStream->Seek(nsISeekableStream::NS_SEEK_SET, tocOffset)))
-      break;
-
-    if (NS_FAILED(rv = ReadTOCEntry(tocInputStream, tocEntry)))
-      break;
-
-    nsCOMPtr<nsIMsgDBHdr> msgHdr;
-    bool reusable;
-
-    rv = msgStore->GetNewMsgOutputStream(dstFolder, getter_AddRefs(msgHdr), &reusable,
-                                         getter_AddRefs(outputStream));
-    if (NS_FAILED(rv))
-      break;
-
-    // Quick and dirty way to read in and parse the message the way the rest
-    // of the code expects.
-    nsCString              defaultDate;
-    nsAutoCString            bodyType;
-    ReadFileState            state;
-
-    // Seek to the start of the email message.
-    mailboxSeekableStream->Seek(nsISeekableStream::NS_SEEK_SET, tocEntry.m_Offset);
-
-    // We're fudging the data to make ReadNextMessage happy. In particular
-    // state.size is meant to be the size of the entire file, because it's
-    // assumed that ReadNextMessage will actually have to parse. We know
-    // exactly how big the message is, so we simply set the "size" to be
-    // immediately where the message ends.
-    state.offset = tocEntry.m_Offset;
-    state.pInputStream = pInputStream;
-    state.size = state.offset + tocEntry.m_Length;
-
-    if (NS_SUCCEEDED(rv = ReadNextMessage(&state, readBuffer, headers, body, defaultDate, bodyType, &tocEntry)))
-    {
-      rv = ImportMessage(headers, body, defaultDate, bodyType, outputStream,
-                         pMsgCount);
-
-      if (pBytes)
-        *pBytes += tocEntry.m_Length;
-      if (NS_SUCCEEDED(rv))
-        msgStore->FinishNewMessage(outputStream, msgHdr);
-      else {
-        msgStore->DiscardNewMessage(outputStream, msgHdr);
-        IMPORT_LOG0( "*** Error importing message\n");
-      }
-    }
-
-    // We currently don't consider an error from ReadNextMessage or ImportMessage to be fatal.
-    // Reset the error back to no error in case this is the last time through the loop.
-    rv = NS_OK;
-
-    tocOffset += kMsgHeaderSize;
-
-    if (!reusable)
-      outputStream->Close();
-  }
-  if (outputStream)
-    outputStream->Close();
-
-  if (NS_SUCCEEDED(rv)) {
-    IMPORT_LOG0(" finished\n");
-  }
-  else {
-    // We failed somewhere important enough that we kept the error.
-    // Bail on all that we imported since we'll be importing everything
-    // again using just the mailbox.
-    IMPORT_LOG0("*** Error importing mailbox using TOC: ");
-//    DUMP_FILENAME(pMail, true);
-
-    // Reset pBytes back to where it was before we imported this mailbox.
-    // This will likely result in a funky progress bar which will move
-    // backwards, but that's probably the best we can do to keep the
-    // progress accurate since we'll be re-importing the same mailbox.
-    if (pBytes)
-      *pBytes = saveBytes;
-
-    // Set the message count back to 0.
-    if (pMsgCount)
-      *pMsgCount = 0;
-  }
-
-  return rv;
-}
-
-nsresult nsEudoraMailbox::ReadTOCEntry(nsIInputStream *pToc, EudoraTOCEntry& tocEntry)
-{
-#define READ_TOC_FIELD(entry) pBuffer = (char *)&entry;\
-  if (NS_FAILED(pToc->Read(pBuffer, sizeof(entry), &bytesRead)) || (bytesRead != sizeof(entry)))\
-    return NS_ERROR_FAILURE
-
-  uint32_t bytesRead = 0;
-  char * pBuffer;
-
-  // Here we'll read any initial data that's in the same format on both Mac and Windows
-  READ_TOC_FIELD(tocEntry.m_Offset);
-  READ_TOC_FIELD(tocEntry.m_Length);
-
-#ifdef XP_MACOSX
-  // Read Mac specific data
-
-#else
-  // Read Windows specific data
-  int16_t      x1 = 0, y1 = 0, x2 = 400, y2 = 300, tzm = 0;
-  int8_t      nIgnoreChar;
-  uint8_t      cJunkInfo = 0;
-  uint32_t    ulJunkPluginID;
-
-  READ_TOC_FIELD(tocEntry.m_Seconds);
-  READ_TOC_FIELD(tocEntry.m_State);
-  READ_TOC_FIELD(tocEntry.m_Flags);
-  READ_TOC_FIELD(tocEntry.m_Priority);
-  READ_TOC_FIELD(nIgnoreChar);
-  READ_TOC_FIELD(tocEntry.m_Date);
-  READ_TOC_FIELD(tocEntry.m_lArrivalSeconds);
-  READ_TOC_FIELD(tocEntry.m_From);
-  READ_TOC_FIELD(tocEntry.m_Subject);
-
-  // We'll read but ignore window position
-  READ_TOC_FIELD(x1);
-  READ_TOC_FIELD(y1);
-  READ_TOC_FIELD(x2);
-  READ_TOC_FIELD(y2);
-
-  READ_TOC_FIELD(tocEntry.m_Label);
-  READ_TOC_FIELD(tocEntry.m_Hash);
-  READ_TOC_FIELD(tocEntry.m_UniqueMessageId);
-  READ_TOC_FIELD(tocEntry.m_FlagsEx);
-  READ_TOC_FIELD(tocEntry.m_PersonaHash);
-
-  READ_TOC_FIELD(tzm);
-  tocEntry.m_TimeZoneMinutes = tzm;
-
-  // IMAP specific info (present, but not useful when POP mailbox)
-  READ_TOC_FIELD(tocEntry.m_Imflags);
-  READ_TOC_FIELD(tocEntry.m_MsgSize);
-
-  // Moodwatch info - may never be worth importing
-  READ_TOC_FIELD(tocEntry.m_nMood);
-
-  // Get the junk score byte
-  READ_TOC_FIELD(cJunkInfo);
-  if (cJunkInfo & 0x80)
-  {
-    // If the high bit is set note that this message was manually junked
-    // and unset the high bit.
-    tocEntry.m_bManuallyJunked = true;
-    cJunkInfo &= 0x7F;
-  }
-  else
-  {
-    tocEntry.m_bManuallyJunked = false;
-  }
-  tocEntry.m_ucJunkScore = cJunkInfo;
-
-  READ_TOC_FIELD(ulJunkPluginID);
-#endif
-
-  return NS_OK;
-}
-
-nsresult nsEudoraMailbox::ImportMessage(
-  SimpleBufferTonyRCopiedOnce &headers,
-  SimpleBufferTonyRCopiedOnce &body,
-  nsCString& defaultDate,
-  nsAutoCString& bodyType,
-  nsIOutputStream *pDst,
-  int32_t  *pMsgCount)
-{
-  nsresult rv = NS_OK;
-  uint32_t written = 0;
-  nsEudoraCompose compose;
-
-  // Unfortunately Eudora stores HTML messages in the sent folder
-  // without any content type header at all. If the first line of the message body is <html>
-  // then mark the message as html internally...See Bug #258489
-  if (body.m_pBuffer && (body.m_writeOffset > (int32_t)strlen(kHTMLTag)) && (strncmp(body.m_pBuffer, kHTMLTag, strlen(kHTMLTag)) == 0))
-    bodyType = "text/html"; // ignore whatever body type we were given...force html
-
-  compose.SetBody(body.m_pBuffer, body.m_writeOffset - 1, bodyType);
-  compose.SetHeaders(headers.m_pBuffer, headers.m_writeOffset - 1);
-  compose.SetAttachments(&m_attachments);
-  compose.SetDefaultDate(defaultDate);
-
-        nsCOMPtr <nsIFile> compositionFile;
-  rv = compose.SendTheMessage(m_mailImportLocation, getter_AddRefs(compositionFile));
-  if (NS_SUCCEEDED(rv)) {
-    nsCString            fromLine(eudoraFromLine);
-    SimpleBufferTonyRCopiedOnce    copy;
-
-    copy.Allocate(kCopyBufferSize);
-
-    /* IMPORT_LOG0("Composed message in file: "); DUMP_FILENAME(compositionFile, true); */
-    // copy the resulting file into the destination file!
-    rv = compose.CopyComposedMessage(fromLine, compositionFile, pDst, copy);
-    DeleteFile(compositionFile);
-    if (NS_FAILED(rv))
-      IMPORT_LOG0("*** Error copying composed message to destination mailbox\n");
-    if (pMsgCount)
-      (*pMsgCount)++;
-  }
-  else {
-    IMPORT_LOG0("*** Error composing message, writing raw message\n");
-    rv = WriteFromSep(pDst);
-
-    rv = pDst->Write(kComposeErrorStr, strlen(kComposeErrorStr), &written);
-
-    if (NS_SUCCEEDED(rv))
-      rv = pDst->Write(headers.m_pBuffer, headers.m_writeOffset - 1, &written);
-    if (NS_SUCCEEDED(rv) && (written == (headers.m_writeOffset - 1)))
-      rv = pDst->Write("\x0D\x0A" "\x0D\x0A", 4, &written);
-    if (NS_SUCCEEDED(rv) && (written == 4))
-      rv = pDst->Write(body.m_pBuffer, body.m_writeOffset - 1, &written);
-    if (NS_SUCCEEDED(rv) && (written == (body.m_writeOffset - 1))) {
-      rv = pDst->Write("\x0D\x0A", 2, &written);
-      if (written != 2)
-        rv = NS_ERROR_FAILURE;
-    }
-
-    if (NS_FAILED(rv))
-      IMPORT_LOG0("*** Error writing to destination mailbox\n");
-  }
-
-  return rv;
-}
-
-nsresult nsEudoraMailbox::ReadNextMessage(ReadFileState *pState, SimpleBufferTonyRCopiedOnce& copy,
-                                          SimpleBufferTonyRCopiedOnce& header, SimpleBufferTonyRCopiedOnce& body,
-                                          nsCString& defaultDate, nsCString& bodyType, EudoraTOCEntry *pTocEntry)
-{
-  header.m_writeOffset = 0;
-  body.m_writeOffset = 0;
-
-  nsresult    rv;
-  int32_t      lineLen;
-  char      endBuffer = 0;
-
-  lineLen = -1;
-  // Find the from separator - we should actually be positioned at the
-  // from separator, but for now, we'll verify this.
-  while (lineLen == -1) {
-    if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-      IMPORT_LOG0("*** Error, FillMailBuffer FAILED in ReadNextMessage\n");
-      return rv;
-    }
-    lineLen = IsEudoraFromSeparator(copy.m_pBuffer + copy.m_writeOffset, copy.m_bytesInBuf - copy.m_writeOffset, defaultDate);
-
-    if (lineLen == -1) {
-      while ((lineLen = FindStartLine(copy)) == -1) {
-        copy.m_writeOffset = copy.m_bytesInBuf;
-        if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-          IMPORT_LOG0("*** Error, FillMailBuffer FAILED in ReadNextMessage, looking for next start line\n");
-          return rv;
-        }
-        if (!copy.m_bytesInBuf) {
-          IMPORT_LOG0("*** Error, ReadNextMessage, looking for start of next line, got end of file.\n");
-          return NS_ERROR_FAILURE;
-        }
-      }
-      copy.m_writeOffset += lineLen;
-      lineLen = -1;
-    }
-  }
-
-  // Skip past the from line separator
-  while ((lineLen = FindStartLine(copy)) == -1) {
-    copy.m_writeOffset = copy.m_bytesInBuf;
-    if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-      IMPORT_LOG0("*** Error, ReadNextMessage, FillMailBuffer failed looking for from sep\n");
-      return rv;
-    }
-    if (!copy.m_bytesInBuf) {
-      IMPORT_LOG0("*** Error, ReadNextMessage, end of file looking for from sep\n");
-      return NS_ERROR_FAILURE;
-    }
-  }
-  copy.m_writeOffset += lineLen;
-  if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-    IMPORT_LOG0("*** Error, Unable to fill mail buffer after from sep.\n");
-    return rv;
-  }
-
-  // This should be the headers...
-  int32_t endLen = -1;
-  while ((endLen = IsEndHeaders(copy)) == -1) {
-    while ((lineLen = FindNextEndLine(copy)) == -1) {
-      copy.m_writeOffset = copy.m_bytesInBuf;
-      if (!header.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-        IMPORT_LOG0("*** ERROR, writing headers\n");
-        return NS_ERROR_FAILURE;
-      }
-      if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-        IMPORT_LOG0("*** Error reading message headers\n");
-        return rv;
-      }
-      if (!copy.m_bytesInBuf) {
-        IMPORT_LOG0("*** Error, end of file while reading headers\n");
-        return NS_ERROR_FAILURE;
-      }
-    }
-    copy.m_writeOffset += lineLen;
-    if ((copy.m_writeOffset + 4) >= copy.m_bytesInBuf) {
-      if (!header.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-        IMPORT_LOG0("*** ERROR, writing headers 2\n");
-        return NS_ERROR_FAILURE;
-      }
-      if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-        IMPORT_LOG0("*** Error reading message headers 2\n");
-        return rv;
-      }
-    }
-  }
-
-  if (!header.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-    IMPORT_LOG0("*** Error writing final headers\n");
-    return NS_ERROR_FAILURE;
-  }
-
-  if (pTocEntry) {
-    // This is not the prettiest spot to stick this code, but it works and it was convenient.
-    char    header_str[128];
-
-    // Write X-Mozilla-Status header
-    PR_snprintf(header_str, 128, MSG_LINEBREAK X_MOZILLA_STATUS_FORMAT MSG_LINEBREAK, pTocEntry->GetMozillaStatusFlags());
-    header.Write(header_str, strlen(header_str));
-
-    // Write X-Mozilla-Status2 header
-    PR_snprintf(header_str, 128, X_MOZILLA_STATUS2_FORMAT MSG_LINEBREAK, pTocEntry->GetMozillaStatus2Flags());
-    header.Write(header_str, strlen(header_str));
-
-    // Format and write X-Mozilla-Keys header
-    nsCString  keywordHdr(X_MOZILLA_KEYWORDS);
-    if (pTocEntry->HasEudoraLabel()) {
-      PR_snprintf(header_str, 128, "eudoralabel%d", pTocEntry->GetLabelNumber());
-      keywordHdr.Replace(sizeof(HEADER_X_MOZILLA_KEYWORDS) + 1, strlen(header_str), header_str);
-    }
-    header.Write(keywordHdr.get(), keywordHdr.Length());
-  }
-
-  if (!header.Write(&endBuffer, 1)) {
-    IMPORT_LOG0("*** Error writing header trailing null\n");
-    return NS_ERROR_FAILURE;
-  }
-
-  copy.m_writeOffset += endLen;
-  if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-    IMPORT_LOG0("*** Error reading beginning of message body\n");
-    return rv;
-  }
-
-  EmptyAttachments();
-
-  // Get the body!
-  // Read one line at a time here and look for the next separator
-  nsCString tmp;
-  bool insideEudoraTags = false;
-  // by default we consider the body text to be plain text
-  bodyType = "text/plain";
-
-  while ((lineLen = IsEudoraFromSeparator(copy.m_pBuffer + copy.m_writeOffset, copy.m_bytesInBuf - copy.m_writeOffset, tmp)) == -1) {
-    int32_t tagLength = 0;
-    if (IsEudoraTag (copy.m_pBuffer + copy.m_writeOffset, copy.m_bytesInBuf - copy.m_writeOffset, insideEudoraTags, bodyType, tagLength)) {
-      // We don't want to keep eudora tags so skip over them.
-
-      // let's write the previous text
-      if (!body.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-        IMPORT_LOG0("*** Error writing to message body\n");
-        return NS_ERROR_FAILURE;
-      }
-
-      // we want to skip over the tag...for now we are assuming the tag is always at the start of line.
-      copy.m_writeOffset += tagLength;
-        if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-          IMPORT_LOG0("*** Error reading message body\n");
-          return rv;
-        }
-
-      if (!copy.m_bytesInBuf)
-        break;
-
-      continue;
-    }
-
-    // Eudora Attachment lines are always outside Eudora Tags
-    // so we shouldn't try to find one here
-    if (!insideEudoraTags) {
-    // Debatable is whether or not to exclude these lines from the
-    // text of the message, I prefer not to in case the original
-    // attachment is actually missing.
-    rv = ExamineAttachment(copy);
-    if (NS_FAILED(rv)) {
-      IMPORT_LOG0("*** Error examining attachment line\n");
-      return rv;
-    }
-    }
-
-    while (((lineLen = FindStartLine(copy)) == -1) && copy.m_bytesInBuf) {
-      copy.m_writeOffset = copy.m_bytesInBuf;
-      if (!body.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-        IMPORT_LOG0("*** Error writing to message body\n");
-        return NS_ERROR_FAILURE;
-      }
-      if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-        IMPORT_LOG0("*** Error reading message body\n");
-        return rv;
-      }
-    }
-    if (!copy.m_bytesInBuf)
-      break;
-
-    copy.m_writeOffset += lineLen;
-
-    // found the start of the next line
-    // make sure it's long enough to check for the from line
-    if ((copy.m_writeOffset + 2048) >= copy.m_bytesInBuf) {
-      if (!body.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-        IMPORT_LOG0("*** Error writing to message body 2\n");
-        return NS_ERROR_FAILURE;
-      }
-      if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-        IMPORT_LOG0("*** Error reading message body 2\n");
-        return rv;
-      }
-    }
-  }
-
-  // the start of the current line is a from, we-re done
-  if (!body.Write(copy.m_pBuffer, copy.m_writeOffset)) {
-    IMPORT_LOG0("*** Error writing final message body\n");
-    return NS_ERROR_FAILURE;
-  }
-  if (!body.Write(&endBuffer, 1)) {
-    IMPORT_LOG0("*** Error writing body trailing null\n");
-    IMPORT_LOG2("\tbody.m_size: %ld, body.m_writeOffset: %ld\n", body.m_size, body.m_writeOffset);
-    return NS_ERROR_FAILURE;
-  }
-  if (NS_FAILED(rv = FillMailBuffer(pState, copy))) {
-    IMPORT_LOG0("*** Error filling mail buffer for next read message\n");
-    return rv;
-  }
-
-  return NS_OK;
-}
-
-int32_t  nsEudoraMailbox::FindStartLine(SimpleBufferTonyRCopiedOnce& data)
-{
-  int32_t len = data.m_bytesInBuf - data.m_writeOffset;
-  if (!len)
-    return -1;
-
-  int32_t count = 0;
-  const char *pData = data.m_pBuffer + data.m_writeOffset;
-  // Skip to next end of line.
-  while ((count < len) && (*pData != nsCRT::CR) && (*pData != nsCRT::LF)) {
-    pData++;
-    count++;
-  }
-  if (count == len)
-    return -1;
-
-  // Skip over end of line(s).
-  while ((count < len) && ((*pData == nsCRT::CR) || (*pData == nsCRT::LF))) {
-    pData++;
-    count++;
-  }
-  if (count < len)
-    return count;
-
-  return -1;
-}
-
-int32_t nsEudoraMailbox::FindNextEndLine(SimpleBufferTonyRCopiedOnce& data)
-{
-  int32_t len = data.m_bytesInBuf - data.m_writeOffset;
-  if (!len)
-    return -1;
-
-  int32_t count = 0;
-  const char *pData = data.m_pBuffer + data.m_writeOffset;
-  // Skip over end of line(s).
-  while ((count < len) && ((*pData == nsCRT::CR) || (*pData == nsCRT::LF))) {
-    pData++;
-    count++;
-  }
-  // Skip to next end of line.
-  while ((count < len) && (*pData != nsCRT::CR) && (*pData != nsCRT::LF)) {
-    pData++;
-    count++;
-  }
-  if (count < len)
-    return count;
-
-  return -1;
-}
-
-int32_t nsEudoraMailbox::IsEndHeaders(SimpleBufferTonyRCopiedOnce& data)
-{
-  int32_t len = data.m_bytesInBuf - data.m_writeOffset;
-  if (len < 2)
-    return -1;
-
-  const char *pChar = data.m_pBuffer + data.m_writeOffset;
-  // Double nsCRT::CR.
-  if ((*pChar == nsCRT::CR) && (*(pChar + 1) == nsCRT::CR))
-    return 2;
-
-  if (len < 4)
-    return -1;
-
-  // Double (nsCRT::CR + nsCRT::LF).
-  if ((*pChar == nsCRT::CR) && (*(pChar + 1) == nsCRT::LF) &&
-      (*(pChar + 2) == nsCRT::CR) && (*(pChar + 3) == nsCRT::LF))
-    return 4;
-
-  return -1;
-}
-
-static const char *eudoraTag[] = {
-  "<x-html>",
-  "</x-html>",
-  "<x-rich>",
-  "</x-rich>",
-  "<x-flowed>",
-  "</x-flowed>"
-};
-
-static int32_t eudoraTagLen[] = {
-  8,
-  9,
-  8,
-  9,
-  10,
-  11,
-  0
-};
-
-static const char *TagContentType[] = {
-  "text/html",
-  "text/html",
-  "text/enriched",
-  "text/enriched",
-  "text/plain",
-  "text/plain",
-};
-
-  // Determine if this line contains an eudora special tag
-bool    nsEudoraMailbox::IsEudoraTag(const char *pChar, int32_t maxLen, bool &insideEudoraTags, nsCString &bodyType, int32_t &tagLength)
-{
-  int32_t  idx = 0;
-  while ((tagLength = eudoraTagLen[idx]) != 0) {
-    if (maxLen >= tagLength && !strncmp(eudoraTag[idx], pChar, tagLength)) {
-      insideEudoraTags = (pChar[1] != '/');
-      bodyType = TagContentType[idx];
-      return true;
-    }
-    idx++;
-  }
-
-  return false;
-}
-
-  // Determine if this line meets Eudora standards for a separator line
-  // This logic is based on Eudora 1.3.1's strict requirements for what
-  // makes a valid separator line.  This may need to be relaxed for newer
-  // versions of Eudora.
-  // A sample from line:
-  // From john@uxc.cso.uiuc.edu Wed Jan 14 12:36:18 1989
-int32_t  nsEudoraMailbox::IsEudoraFromSeparator(const char *pChar, int32_t maxLen, nsCString& defaultDate)
-{
-  if (maxLen < 12)
-    return -1;
-
-  int32_t    len = 0;
-  if ((*pChar != 'F') || (*(pChar + 1) != 'r') || (*(pChar + 2) != 'o') || (*(pChar + 3) != 'm'))
-    return -1;
-  pChar += 4;
-  len += 4;
-
-  // According to Eudora the next char MUST be a space, and there can only be 1 space
-  // before the return mail address.
-  // I'll be nicer and allow any amount of whitespace
-  while (((*pChar == ' ') || (*pChar == '\t')) && (len < maxLen)) {
-    pChar++;
-    len++;
-  }
-  if (len == maxLen)
-    return -1;
-
-  // Determine the length of the line
-  int32_t      lineLen = len;
-  const char *  pTok = pChar;
-  // Skip to next end of line.
-  while ((lineLen < maxLen) && (*pTok != nsCRT::CR) && (*pTok != nsCRT::LF)) {
-    lineLen++;
-    pTok++;
-  }
-  if (len >= lineLen)
-    return -1;
-
-  // Eudora allows the return address to be double quoted or not at all..
-  // I'll allow single or double quote, but other than that, just skip
-  // the return address until you hit a space char (I allow tab as well)
-  char  quote = *pChar;
-  if ((quote == '"') || (quote == '\'')) {
-    pChar++;
-    len++;
-    while ((len < lineLen) && (*pChar != quote)) {
-      pChar++;
-      len++;
-    }
-    if (len == lineLen)
-      return -1;
-    len++;
-    pChar++;
-  }
-  else {
-    while ((len < lineLen) && (*pChar != ' ') && (*pChar != '\t')) {
-      pChar++;
-      len++;
-    }
-  }
-  while (((*pChar == ' ') || (*pChar == '\t')) && (len < lineLen)) {
-    pChar++;
-    len++;
-  }
-  if (len == lineLen)
-    return -1;
-
-  // we've passed the address, now check for the remaining data
-  // Now it gets really funky!
-  // In no particular order, with token separators space, tab, comma, newline
-  // a - the phrase "remote from", remote must be first, from is optional.  2 froms or 2 remotes fails
-  // b - one and only one time value xx:xx or xx:xx:xx
-  // c - one and only one day, 1 to 31
-  // d - one and only one year, 2 digit anything or 4 digit > 1900
-  // e - one and only one weekday, 3 letter abreviation
-  // f - one and only one month, 3 letter abreviation
-  // 2 allowable "other" tokens
-  // to be valid, day, year, month, & tym must exist and other must be less than 3
-
-  int    day = 0;
-  int    month = 0;
-  int    year = 0;
-  int    weekDay = 0;
-  int    other = 0;
-  int    result;
-  char  tymStr[9];  // Make it a null terminated string (used in PR_snprintf() call()).
-  bool    tym = false;
-  bool    remote = false;
-  bool    from = false;
-  int32_t  tokLen;
-  int32_t  tokStart;
-  int32_t  num;
-
-  while ((len < lineLen) && (other < 3)) {
-    pTok = pChar;
-    tokStart = len;
-    while ((len < lineLen) && (*pChar != ' ') && (*pChar != '\t') && (*pChar != ',')) {
-      pChar++;
-      len++;
-    }
-    tokLen = len - tokStart;
-    if (tokLen) {
-      num = AsciiToLong(pTok, tokLen);
-      if ((tokLen == 3) && ((result = IsWeekDayStr(pTok)) != 0)) {
-        if (weekDay)
-          return -1;
-        weekDay = result;
-      }
-      else if ((tokLen == 3) && ((result = IsMonthStr(pTok)) != 0)) {
-        if (month)
-          return -1;
-        month = result;
-      }
-      else if ((tokLen == 6) && !PL_strncasecmp(pTok, "remote", 6)) {
-        if (remote || from)
-          return -1;
-        remote = true;
-      }
-      else if ((tokLen == 4) && !PL_strncasecmp(pTok, "from", 4)) {
-        if (!remote || from)
-          return -1;
-        from = true;
-      }
-      else if ((tokLen == 4) && ((num > 1900) || !strncmp(pTok, "0000", 4))) {
-        if (year)
-          return -1;
-        year = (int)num;
-        if (!year)
-          year = 1900;
-      }
-      else if (!year && day && (tokLen == 2) && (*(pTok + 1) >= '0') && (*(pTok + 1) <= '9')) {
-        if (num < 65)
-          num += 1900;
-        else
-           num += 2000;
-         year = (int) num;
-      }
-      else if ((tokLen <= 2) && (*pTok >= '0') && (*pTok <= '9')) {
-        day = (int) num;
-        if ((day < 1) || (day > 31))
-          day = 1;
-      }
-      else if ((tokLen >= 5) && (pTok[2] == ':') && ((tokLen == 5) || ((tokLen == 8) && (pTok[5] == ':')))) {
-        // looks like the tym...
-        for (result = 0; result < (int)tokLen; result++) {
-          if ((result != 2) && (result != 5)) {
-            if ((pTok[result] < '0') || (pTok[result] > '9')) {
-              break;
-            }
-          }
-        }
-        if (result == tokLen) {
-          if (tym)
-            return -1;
-          tym = true;
-          // for future use, get the time value
-          memcpy(tymStr, pTok, tokLen);
-          if (tokLen == 5) {
-            tymStr[5] = ':';
-            tymStr[6] = '0';
-            tymStr[7] = '0';
-          }
-          tymStr[8] = 0;
-        }
-        else {
-          other++;
-        }
-      }
-      else
-        other++;
-    }
-    // Skip the space chars...
-    while ((len < lineLen) && ((*pChar == ' ') || (*pChar == '\t') || (*pChar == ','))) {
-      pChar++;
-      len++;
-    }
-  } // end while (len < lineLen) token loop
-
-  // Now let's see what we found on the line
-  if (day && year && month && tym && (other < 3)) {
-    // Now we need to make sure the next line
-    // isn't blank!
-    while (len < lineLen) {
-      len++;
-      pChar++;
-    }
-    if (len == maxLen)
-      return -1;
-
-    if (*pChar == nsCRT::CR) {
-      len++;
-      pChar++;
-      if (*pChar == nsCRT::LF) {
-        len++;
-        pChar++;
-      }
-    }
-    else if (*pChar == nsCRT::LF) {
-      len++;
-      pChar++;
-    }
-    else
-      return -1;
-
-    if (len >= maxLen)
-      return -1;
-
-    while (len < maxLen) {
-      if ((*pChar == nsCRT::CR) || (*pChar == nsCRT::LF))
-        return -1;
-
-      if ((*pChar != ' ') && (*pChar != '\t'))
-        break;
-
-      pChar++;
-      len++;
-    }
-
-    // Whew!, the next line isn't blank.
-    // Generate the default date header in case the date header is missing when we
-    // write out headers later. The header looks like "Date: Tue, 5 Feb 2002 23:05:04"
-    char date_header_str[DATE_STR_LEN];
-    PR_snprintf(date_header_str, DATE_STR_LEN, "Date: %s, %2d %s %4d %s", eudoraWeekDays[weekDay-1], day, eudoraMonths[month-1], year, tymStr);
-    defaultDate.Assign(date_header_str);
-
-    return lineLen;
-  }
-
-  return -1;
-}
-
-int32_t nsEudoraMailbox::AsciiToLong(const char *pChar, int32_t len)
-{
-  int32_t num = 0;
-  while (len) {
-    if ((*pChar < '0') || (*pChar > '9'))
-      return num;
-    num *= 10;
-    num += (*pChar - '0');
-    len--;
-    pChar++;
-  }
-  return num;
-}
-
-int nsEudoraMailbox::IsWeekDayStr(const char *pStr)
-{
-  for (int i = 0; i < 7; i++) {
-    if (!PL_strncasecmp(pStr, eudoraWeekDays[i], 3))
-      return i + 1;
-  }
-  return 0;
-}
-
-int nsEudoraMailbox::IsMonthStr(const char *pStr)
-{
-  for (int i = 0; i < 12; i++) {
-    if (!PL_strncasecmp(pStr, eudoraMonths[i], 3))
-      return i + 1;
-  }
-  return 0;
-}
-
-nsresult nsEudoraMailbox::WriteFromSep(nsIOutputStream *pDst)
-{
-  if (!m_fromLen)
-    m_fromLen = strlen(eudoraFromLine);
-  uint32_t  written = 0;
-  nsresult rv = pDst->Write(eudoraFromLine, m_fromLen, &written);
-  if (NS_SUCCEEDED(rv) && (written != m_fromLen))
-    return NS_ERROR_FAILURE;
-  return rv;
-}
-
-void nsEudoraMailbox::EmptyAttachments(void)
-{
-  int32_t max = m_attachments.Length();
-  ImportAttachment *  pAttach;
-  for (int32_t i = 0; i < max; i++) {
-    pAttach = m_attachments.ElementAt(i);
-    if (pAttach) {
-      NS_Free(pAttach->description);
-      NS_Free(pAttach->mimeType);
-      delete pAttach;
-    }
-  }
-
-  m_attachments.Clear();
-}
-
-static const char *eudoraAttachLines[] = {
-  "Attachment Converted:",
-  "Attachment converted:",
-  "Pičce jointe convertie :",
-  // Japanese text encoded with Shift-JIS.
-  // The meaning is "Restored attached file".
-  "\x95\x9c\x8c\xb3\x82\xb3\x82\xea\x82\xbd\x93\x59\x95\x74\x83\x74\x83\x40\x83\x43\x83\x8b\x81\x46"
-};
-
-static int32_t eudoraAttachLen[] = {
-  21,
-  21,
-  24,
-  24,
-  0
-};
-
-nsresult nsEudoraMailbox::ExamineAttachment(SimpleBufferTonyRCopiedOnce& data)
-{
-  // get the file, then get the mime type, and add it to the array
-  // of attachments.
-  int32_t    len = data.m_bytesInBuf - data.m_writeOffset;
-  const char *pChar = data.m_pBuffer + data.m_writeOffset;
-  const char *pData;
-  const char *pStart;
-  int32_t  nameLen;
-  char  quote;
-  int32_t  cnt;
-  int32_t  idx = 0;
-  while ((cnt = eudoraAttachLen[idx]) != 0) {
-    if (!strncmp(eudoraAttachLines[idx], pChar, cnt)) {
-      pData = pChar + cnt;
-      while (((*pData == ' ') || (*pData == '\t')) && (cnt < len)) {
-        cnt++;
-        pData++;
-      }
-      if (pData != pChar) {
-        quote = *pData;
-        nameLen = 0;
-        if ((quote == '"') || (quote == '\'')) {
-          pData++;
-          cnt++;
-          pStart = pData;
-          while ((*pData != quote) && (cnt < len)) {
-            cnt++;
-            pData++;
-            nameLen++;
-          }
-        }
-        else {
-          pStart = pData;
-          // Skip to next end of line.
-          while ((cnt < len) &&
-                 (*pData != nsCRT::CR) && (*pData != nsCRT::LF)) {
-            pData++;
-            cnt++;
-            nameLen++;
-          }
-        }
-        nsCString  fileName;
-        fileName.Append(pStart, nameLen);
-        fileName.Trim(kWhitespace);
-        if (fileName.Length()) {
-#ifdef XP_MACOSX
-          return NS_OK;
-#else
-          if(AddAttachment(fileName))
-            return NS_OK;
-#endif
-        }
-      }
-    }
-    idx++;
-  }
-
-  return NS_OK;
-}
-
-bool nsEudoraMailbox::AddAttachment(nsCString& fileName)
-{
-  IMPORT_LOG1("Found attachment: %s\n", fileName.get());
-
-  nsresult rv;
-  nsCOMPtr <nsIFile>  pFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
-  if (NS_FAILED(rv))
-    return false;
-
-  nsCString mimeType;
-  nsCString attachmentName;
-  if (NS_FAILED(GetAttachmentInfo(fileName.get(), pFile, mimeType, attachmentName)))
-    return false;
-
-  ImportAttachment *a = new ImportAttachment;
-  a->mimeType = ToNewCString(mimeType);
-  a->description = !attachmentName.IsEmpty() ? ToNewCString(attachmentName) : strdup("Attached File");
-  a->pAttachment = pFile;
-
-  m_attachments.AppendElement(a);
-
-  return true;
-}
-
-nsresult nsEudoraMailbox::FillMailBuffer(ReadFileState *pState, SimpleBufferTonyRCopiedOnce& read)
-{
-  if (read.m_writeOffset >= read.m_bytesInBuf) {
-    read.m_writeOffset = 0;
-    read.m_bytesInBuf = 0;
-  }
-  else if (read.m_writeOffset) {
-    memcpy(read.m_pBuffer, read.m_pBuffer + read.m_writeOffset, read.m_bytesInBuf - read.m_writeOffset);
-    read.m_bytesInBuf -= read.m_writeOffset;
-    read.m_writeOffset = 0;
-  }
-
-  uint32_t  count = read.m_size - read.m_bytesInBuf;
-  if ((count + pState->offset) > pState->size)
-    count = pState->size - pState->offset;
-  if (count) {
-    uint32_t    bytesRead = 0;
-    char *    pBuffer = read.m_pBuffer + read.m_bytesInBuf;
-    nsresult  rv = pState->pInputStream->Read(pBuffer, count, &bytesRead);
-    if (NS_FAILED(rv))
-      return rv;
-    if (bytesRead != uint32_t(count))
-      return NS_ERROR_FAILURE;
-    read.m_bytesInBuf += bytesRead;
-    pState->offset += bytesRead;
-  }
-
-  return NS_OK;
-}
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraMailbox.h
+++ /dev/null
@@ -1,201 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsEudoraMailbox_h__
-#define nsEudoraMailbox_h__
-
-#include "nscore.h"
-#include "nsStringGlue.h"
-#include "nsTArray.h"
-#include "nsIFile.h"
-#include "nsEudoraCompose.h"
-
-class nsIOutputStream;
-class nsIMutableArray;
-
-/////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////
-
-class EudoraTOCEntry {
-public:
-  uint16_t    GetMozillaStatusFlags();
-  uint32_t    GetMozillaStatus2Flags();
-
-  int32_t      m_Offset;
-  int32_t      m_Length;
-#ifdef XP_MACOSX
-  // Mac specific flags and fields for reading message summaries
-  bool        HasEudoraLabel() { return false; }
-  int16_t      GetLabelNumber() { return 0; }
-
-#else
-  // Windows specific flags and fields for reading message summaries
-  bool        HasEudoraLabel() { return (m_Label > 0) && (m_Label <= 7); }
-  int16_t      GetLabelNumber() { return HasEudoraLabel() ? m_Label : 0; }
-
-  // MesSummary flags (used with m_Flags)
-  static const uint16_t MSF_ALT_SIGNATURE    = 0x0001;
-  static const uint16_t MSF_USE_SIGNATURE    = 0x0002;
-  static const uint16_t MSF_WORD_WRAP      = 0x0004;
-  static const uint16_t MSF_TABS_IN_BODY    = 0x0008;
-  static const uint16_t MSF_KEEP_COPIES    = 0x0010;
-  static const uint16_t MSF_TEXT_AS_DOC    = 0x0020;
-  static const uint16_t MSF_RETURN_RECEIPT  = 0x0040;
-  static const uint16_t MSF_QUOTED_PRINTABLE  = 0x0080;
-  static const uint16_t MSF_ENCODE0      = 0x0100;
-  static const uint16_t MSF_ENCODE1      = 0x0200;
-  static const uint16_t MSF_SHOW_ALL_HEADERS  = 0x0400;
-  static const uint16_t MSF_SUB_PART      = 0x0800;
-  static const uint16_t MSF_MAPI_MESSAGE    = 0x1000;
-  static const uint16_t MSF_XRICH        = 0x2000;
-  static const uint16_t MSF_READ_RECEIPT    = 0x4000;
-  static const uint16_t MSF_HAS_ATTACHMENT  = 0x8000;
-  static const uint16_t MSF_COMP_MOD_FLAGS  = 0x8FFF;
-  static const uint16_t MSF_BINHEX      = 0;
-  static const uint16_t MSF_MIME        = MSF_ENCODE0;
-  static const uint16_t MSF_UUENCODE      = MSF_ENCODE1;
-
-  // MesSummary extended flags (used with m_FlagsEx)
-  static const uint16_t MSFEX_AUTO_ATTACHED  = 0x0001;
-  static const uint16_t MSFEX_HTML      = 0x0002;
-  static const uint16_t MSFEX_MDN        = 0x0004;
-  static const uint16_t MSFEX_MIME_ATTACHED  = 0x0008;
-  static const uint16_t MSFEX_SEND_PLAIN    = 0x0010;
-  static const uint16_t MSFEX_SEND_STYLED    = 0x0020;
-  static const uint16_t MSFEX_FLOWED      = 0x0040;
-  static const uint16_t MSFEX_INL_SIGNATURE  = 0x0080;
-  static const uint16_t MSFEX_EMPTY_BODY    = 0x0100;
-
-  // MesSummary states
-  static const int8_t MS_UNREAD    = 0;
-  static const int8_t MS_READ      = 1;
-  static const int8_t MS_REPLIED    = 2;
-  static const int8_t MS_FORWARDED  = 3;
-  static const int8_t MS_REDIRECT    = 4;
-  static const int8_t MS_UNSENDABLE  = 5;
-  static const int8_t MS_SENDABLE    = 6;
-  static const int8_t MS_QUEUED    = 7;
-  static const int8_t MS_SENT      = 8;
-  static const int8_t MS_UNSENT    = 9;
-  static const int8_t MS_TIME_QUEUED  =10;
-  static const int8_t MS_SPOOLED    =11;
-  static const int8_t MS_RECOVERED  =12;
-
-  // MesSummary priorites
-  static const int16_t MSP_HIGHEST  = 1;
-  static const int16_t MSP_HIGH    = 2;
-  static const int16_t MSP_NORMAL    = 3;
-  static const int16_t MSP_LOW    = 4;
-  static const int16_t MSP_LOWEST    = 5;
-
-  // MesSummary Mood
-  static const int8_t MSM_MOOD_UNKNOWN  = 0;
-  static const int8_t MSM_MOOD_CLEAN    = 1;
-  static const int8_t MSM_MOOD_LOW    = 2;
-  static const int8_t MSM_MOOD_MEDIUM    = 3;
-  static const int8_t MSM_MOOD_HIGH    = 4;
-
-  // Imap message flags :
-  static const uint32_t IMFLAGS_SEEN    = 0x00000001;
-  static const uint32_t IMFLAGS_ANSWERED  = 0x00000002;
-  static const uint32_t IMFLAGS_FLAGGED  = 0x00000004;
-  static const uint32_t IMFLAGS_DELETED  = 0x00000008;
-  static const uint32_t IMFLAGS_DRAFT    = 0x00000010;
-  static const uint32_t IMFLAGS_RECENT  = 0x00000020;
-
-  uint16_t    m_Flags;
-  uint16_t    m_FlagsEx;
-  uint32_t    m_Hash;
-  uint32_t    m_UniqueMessageId;
-  uint32_t    m_PersonaHash;
-  int16_t      m_State;
-  uint8_t      m_ucJunkScore;
-  bool        m_bManuallyJunked;
-  int8_t      m_Priority;
-  int8_t      m_nMood;
-  int16_t      m_Label;
-  int32_t      m_Seconds;
-  int32_t      m_lArrivalSeconds;
-  int32_t      m_TimeZoneMinutes;
-  char      m_Date[28];
-  char      m_From[64];
-  char      m_Subject[64];
-
-  // IMAP specific attributes
-  uint32_t    m_Imflags;    // IMAP message flags - 4 bytes.
-  uint16_t    m_MsgSize;
-  int32_t      m_nUndownloadedAttachments;  // Number of undownloaded attachments.
-#endif
-};
-
-class nsEudoraMailbox {
-public:
-  nsEudoraMailbox();
-  virtual ~nsEudoraMailbox();
-
-  // Things that must be overridden because they are platform specific.
-    // retrieve the mail folder
-  virtual bool      FindMailFolder(nsIFile **pFolder) { return false;}
-    // get the list of mailboxes
-  virtual nsresult  FindMailboxes(nsIFile *pRoot, nsIMutableArray *pArray) { return NS_ERROR_FAILURE;}
-    // get the toc file corresponding to this mailbox
-  virtual nsresult  FindTOCFile(nsIFile *pMailFile, nsIFile **pTOCFile, bool *pDeleteToc) { return NS_ERROR_FAILURE;}
-    // interpret the attachment line and return the attached file
-  virtual nsresult  GetAttachmentInfo(const char *pFileName, nsIFile *pFile, nsCString& mimeType, nsCString& aAttachment) { return NS_ERROR_FAILURE;}
-
-  // Non-platform specific common stuff
-    // import a mailbox
-  nsresult ImportMailbox(uint32_t *pBytes, bool *pAbort, const char16_t *pName,
-                         nsIFile *pSrc, nsIMsgFolder *pDst, int32_t *pMsgCount);
- 
-
-  static int32_t    IsEudoraFromSeparator(const char *pData, int32_t maxLen, nsCString& defaultDate);
-  static bool      IsEudoraTag(const char *pChar, int32_t maxLen, bool &insideEudoraTags, nsCString &bodyType, int32_t& tagLength);
-
-protected:
-  nsresult  CreateTempFile(nsIFile **ppFile);
-  nsresult  DeleteFile(nsIFile *pFile);
-
-
-private:
-  nsresult ImportMailboxUsingTOC(uint32_t *pBytes, bool *pAbort,
-                                 nsIInputStream *pInputStream,
-                                 nsIFile *tocFile,
-                                 nsIMsgFolder *pDstFolder, int32_t *pMsgCount);
-
-   nsresult  ReadTOCEntry(nsIInputStream *pToc, EudoraTOCEntry& tocEntry);
-   nsresult  ImportMessage(SimpleBufferTonyRCopiedOnce& headers, SimpleBufferTonyRCopiedOnce& body, nsCString& defaultDate, nsAutoCString& bodyType, nsIOutputStream *pDst, int32_t *pMsgCount);
-   nsresult  ReadNextMessage(ReadFileState *pState, SimpleBufferTonyRCopiedOnce& copy, SimpleBufferTonyRCopiedOnce& header,
-                                        SimpleBufferTonyRCopiedOnce& body, nsCString& defaultDate,
-                                        nsCString &defBodyType, EudoraTOCEntry *pTocEntry);
-  int32_t    FindStartLine(SimpleBufferTonyRCopiedOnce& data);
-  int32_t    FindNextEndLine(SimpleBufferTonyRCopiedOnce& data);
-  int32_t    IsEndHeaders(SimpleBufferTonyRCopiedOnce& data);
-  nsresult  WriteFromSep(nsIOutputStream *pDst);
-  nsresult  FillMailBuffer(ReadFileState *pState, SimpleBufferTonyRCopiedOnce& read);
-
-  void    EmptyAttachments(void);
-  nsresult  ExamineAttachment(SimpleBufferTonyRCopiedOnce& data);
-  bool      AddAttachment(nsCString& fileName);
-
-  static int32_t    AsciiToLong(const char *pChar, int32_t len);
-  static int      IsWeekDayStr(const char *pStr);
-  static int      IsMonthStr(const char *pStr);
-
-protected:
-  nsCOMPtr <nsIFile>    m_mailImportLocation;
-
-private:
-  int64_t    m_mailSize;
-  uint32_t      m_fromLen;
-  nsTArray<ImportAttachment*>  m_attachments;
-};
-
-
-
-#endif /* nsEudoraMailbox_h__ */
-
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraSettings.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
-  Eudora settings
-*/
-
-#include "nsCOMPtr.h"
-#include "nscore.h"
-#include "nsEudoraSettings.h"
-#include "nsEudoraStringBundle.h"
-#include "nsComponentManagerUtils.h"
-#include "EudoraDebugLog.h"
-
-#if defined(XP_WIN)
-#include "nsEudoraWin32.h"
-#endif
-#ifdef XP_MACOSX
-#include "nsEudoraMac.h"
-#endif
-
-
-////////////////////////////////////////////////////////////////////////
-nsresult nsEudoraSettings::Create(nsIImportSettings** aImport)
-{
-    NS_PRECONDITION(aImport != nullptr, "null ptr");
-    if (! aImport)
-        return NS_ERROR_NULL_POINTER;
-
-    *aImport = new nsEudoraSettings();
-    if (! *aImport)
-        return NS_ERROR_OUT_OF_MEMORY;
-
-    NS_ADDREF(*aImport);
-    return NS_OK;
-}
-
-nsEudoraSettings::nsEudoraSettings()
-{
-}
-
-nsEudoraSettings::~nsEudoraSettings()
-{
-}
-
-NS_IMPL_ISUPPORTS(nsEudoraSettings, nsIImportSettings)
-
-NS_IMETHODIMP nsEudoraSettings::AutoLocate(char16_t **description, nsIFile **location, bool *_retval)
-{
-    NS_PRECONDITION(description != nullptr, "null ptr");
-    NS_PRECONDITION(_retval != nullptr, "null ptr");
-    NS_PRECONDITION(location != nullptr, "null ptr");
-  if (!description || !_retval || !location)
-    return NS_ERROR_NULL_POINTER;
-
-  *description = nullptr;
-  *_retval = false;
-
-  nsresult  rv;
-        m_pLocation =  do_CreateInstance (NS_LOCAL_FILE_CONTRACTID, &rv);
-        NS_ENSURE_SUCCESS(rv, rv);
-  *description = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_NAME);
-
-#if defined(XP_WIN)
-  *_retval = nsEudoraWin32::FindSettingsFile(getter_AddRefs(m_pLocation));
-#endif
-
-  NS_IF_ADDREF(*location = m_pLocation);
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsEudoraSettings::SetLocation(nsIFile *location)
-{
-  m_pLocation = location;
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsEudoraSettings::Import(nsIMsgAccount **localMailAccount, bool *_retval)
-{
-  NS_PRECONDITION(_retval != nullptr, "null ptr");
-
-  *_retval = false;
-
-  // Get the settings file if it doesn't exist
-  if (!m_pLocation) {
-#if defined(XP_WIN)
-    nsresult  rv;
-                m_pLocation =  do_CreateInstance (NS_LOCAL_FILE_CONTRACTID, &rv);
-    if (NS_SUCCEEDED(rv)) {
-      if (!nsEudoraWin32::FindSettingsFile(getter_AddRefs(m_pLocation))) {
-        m_pLocation = nullptr;
-      }
-    }
-#endif
-#ifdef XP_MACOSX
-                nsEudoraMac::FindSettingsFile(getter_AddRefs(m_pLocation));
-#endif
-  }
-
-  if (!m_pLocation) {
-    IMPORT_LOG0("*** Error, unable to locate settings file for import.\n");
-    return NS_ERROR_FAILURE;
-  }
-
-  // do the settings import
-#if defined(XP_WIN)
-  *_retval = nsEudoraWin32::ImportSettings(m_pLocation, localMailAccount);
-#endif
-#ifdef XP_MACOSX
-  *_retval = nsEudoraMac::ImportSettings(m_pLocation, localMailAccount);
-#endif
-
-  if (*_retval) {
-    IMPORT_LOG0("Successful import of eudora settings\n");
-  }
-  else {
-    IMPORT_LOG0("*** Error, Unsuccessful import of eudora settings\n");
-  }
-
-  return NS_OK;
-}
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraSettings.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsEudoraSettings_h___
-#define nsEudoraSettings_h___
-
-#include "nsIImportSettings.h"
-#include "nsIFile.h"
-#include "nsCOMPtr.h"
-
-class nsEudoraSettings : public nsIImportSettings {
-public:
-    nsEudoraSettings();
-
-  static nsresult Create(nsIImportSettings** aImport);
-
-    // nsISupports interface
-    NS_DECL_ISUPPORTS
-
-  // nsIImportSettings interface
-  NS_DECL_NSIIMPORTSETTINGS
-
-private:
-  virtual ~nsEudoraSettings();
-  nsCOMPtr<nsIFile> m_pLocation;
-};
-
-#endif /* nsEudoraSettings_h___ */
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraStringBundle.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "prprf.h"
-#include "prmem.h"
-#include "nsCOMPtr.h"
-#include "nsIStringBundle.h"
-#include "nsEudoraStringBundle.h"
-#include "nsServiceManagerUtils.h"
-#include "nsIURI.h"
-#include "nsTextFormatter.h"
-#include "mozilla/Services.h"
-
-#define EUDORA_MSGS_URL       "chrome://messenger/locale/eudoraImportMsgs.properties"
-
-nsIStringBundle *  nsEudoraStringBundle::m_pBundle = nullptr;
-
-nsIStringBundle *nsEudoraStringBundle::GetStringBundle(void)
-{
-  if (m_pBundle)
-    return m_pBundle;
-
-  const char*       propertyURL = EUDORA_MSGS_URL;
-  nsIStringBundle*  sBundle = nullptr;
-
-  nsCOMPtr<nsIStringBundleService> sBundleService =
-    mozilla::services::GetStringBundleService();
-  if (sBundleService)
-    sBundleService->CreateBundle(propertyURL, &sBundle);
-
-  m_pBundle = sBundle;
-  return sBundle;
-}
-
-void nsEudoraStringBundle::GetStringByID(int32_t stringID, nsString& result)
-{
-
-  char16_t *ptrv = GetStringByID(stringID);
-  result = ptrv;
-  FreeString(ptrv);
-}
-
-char16_t *nsEudoraStringBundle::GetStringByID(int32_t stringID)
-{
-  if (!m_pBundle)
-    m_pBundle = GetStringBundle();
-
-  if (m_pBundle)
-  {
-    char16_t *ptrv = nullptr;
-    nsresult rv = m_pBundle->GetStringFromID(stringID, &ptrv);
-
-    if (NS_SUCCEEDED(rv) && ptrv)
-      return ptrv;
-  }
-
-  nsString resultString(NS_LITERAL_STRING("[StringID "));
-  resultString.AppendInt(stringID);
-  resultString.AppendLiteral("?]");
-
-  return ToNewUnicode(resultString);
-}
-
-nsString nsEudoraStringBundle::FormatString(int32_t stringID, ...)
-{
-  // Yeah, I know.  This causes an extra string buffer allocation, but there's no guarantee
-  // that nsString's free and nsTextFormatter::smprintf_free deallocate memory the same way.
-  nsAutoString format;
-  GetStringByID(stringID, format);
-
-  va_list args;
-  va_start(args, stringID);
-
-  char16_t *pText = nsTextFormatter::vsmprintf(format.get(), args);
-  va_end(args);
-
-  nsString result(pText);
-  nsTextFormatter::smprintf_free(pText);
-  return result;
-}
-
-void nsEudoraStringBundle::Cleanup(void)
-{
-  if (m_pBundle)
-    m_pBundle->Release();
-  m_pBundle = nullptr;
-}
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraStringBundle.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsEudoraStringBundle_H__
-#define nsEudoraStringBundle_H__
-
-#include "nsStringGlue.h"
-
-class nsIStringBundle;
-
-class nsEudoraStringBundle {
-public:
-  static char16_t       *  GetStringByID(int32_t stringID);
-  static void               GetStringByID(int32_t stringID, nsString& result);
-  static nsString           FormatString(int32_t stringID, ...);
-  static nsIStringBundle *  GetStringBundle(void); // don't release
-  static void               FreeString(char16_t *pStr) { NS_Free(pStr);}
-  static void               Cleanup(void);
-
-private:
-  static nsIStringBundle *  m_pBundle;
-};
-
-
-
-#define EUDORAIMPORT_NAME                               2000
-#define EUDORAIMPORT_DESCRIPTION                        2029
-#define EUDORAIMPORT_MAILBOX_SUCCESS                    2002
-#define EUDORAIMPORT_MAILBOX_BADPARAM                   2003
-#define EUDORAIMPORT_MAILBOX_BADSOURCEFILE              2004
-#define EUDORAIMPORT_MAILBOX_CONVERTERROR               2005
-#define EUDORAIMPORT_ACCOUNTNAME                        2006
-
-#define EUDORAIMPORT_NICKNAMES_NAME                     2007
-#define EUDORAIMPORT_ADDRESS_SUCCESS                    2008
-#define EUDORAIMPORT_ADDRESS_BADPARAM                   2009
-#define EUDORAIMPORT_ADDRESS_BADSOURCEFILE              2010
-#define EUDORAIMPORT_ADDRESS_CONVERTERROR               2011
-#define EUDORAIMPORT_ADDRESS_LABEL_HOMEMOBILE           2012
-#define EUDORAIMPORT_ADDRESS_LABEL_WORKMOBILE           2013
-#define EUDORAIMPORT_ADDRESS_LABEL_HOMEFAX              2014
-#define EUDORAIMPORT_ADDRESS_LABEL_WORKFAX              2015
-#define EUDORAIMPORT_ADDRESS_LABEL_OTHEREMAIL           2016
-#define EUDORAIMPORT_ADDRESS_LABEL_OTHERPHONE           2017
-#define EUDORAIMPORT_ADDRESS_LABEL_OTHERWEB             2018
-
-#define EUDORAIMPORT_FILTERS_WARN_OUTGOING              2019
-#define EUDORAIMPORT_FILTERS_WARN_ACTION                2020
-#define EUDORAIMPORT_FILTERS_WARN_VERB                  2021
-#define EUDORAIMPORT_FILTERS_WARN_EMPTY_HEADER          2027
-#define EUDORAIMPORT_FILTERS_WARN_NEGATE_VERB           2023
-#define EUDORAIMPORT_FILTERS_WARN_META_HEADER           2028
-#define EUDORAIMPORT_FILTERS_WARN_MAILBOX_MISSING       2025
-
-#endif /* nsEudoraStringBundle_H__ */
deleted file mode 100644
--- a/mailnews/import/eudora/src/nsEudoraWin32.cpp
+++ /dev/null
@@ -1,1602 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsCOMPtr.h"
-#include "nsMsgUtils.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
-#include "nsIMsgAccountManager.h"
-#include "nsIMsgAccount.h"
-#include "nsIMutableArray.h"
-#include "nsIPop3IncomingServer.h"
-#include "nsMsgBaseCID.h"
-#include "nsMsgCompCID.h"
-#include "nsISmtpService.h"
-#include "nsISmtpServer.h"
-#include "nsEudoraWin32.h"
-#include "nsIImportService.h"
-#include "nsIImportMailboxDescriptor.h"
-#include "nsIImportABDescriptor.h"
-#include "nsEudoraStringBundle.h"
-#include "nsEudoraImport.h"
-#include "nsUnicharUtils.h"
-#include "nsCRT.h"
-#include "nsNetUtil.h"
-#include "nsILineInputStream.h"
-#include "EudoraDebugLog.h"
-#include "prmem.h"
-#include "plstr.h"
-#include <algorithm>
-
-static NS_DEFINE_IID(kISupportsIID,      NS_ISUPPORTS_IID);
-
-static const char *  kWhitespace = "\b\t\r\n ";
-
-BYTE * nsEudoraWin32::GetValueBytes(HKEY hKey, const char *pValueName)
-{
-  LONG err;
-  DWORD bufSz;
-  LPBYTE pBytes = NULL;
-
-  err = ::RegQueryValueEx(hKey, pValueName, NULL, NULL, NULL, &bufSz);
-  if (err == ERROR_SUCCESS)
-  {
-    pBytes = new BYTE[bufSz];
-    err = ::RegQueryValueEx(hKey, pValueName, NULL, NULL, pBytes, &bufSz);
-    if (err != ERROR_SUCCESS)
-    {
-      delete [] pBytes;
-      pBytes = NULL;
-    }
-  }
-
-  return pBytes;
-}
-
-
-nsEudoraWin32::nsEudoraWin32()
-{
-  m_pMimeSection = nullptr;
-}
-
-nsEudoraWin32::~nsEudoraWin32()
-{
-  delete [] m_pMimeSection;
-}
-
-bool nsEudoraWin32::FindMailFolder(nsIFile **pFolder)
-{
-  return FindEudoraLocation(pFolder);
-}
-
-bool nsEudoraWin32::FindEudoraLocation(nsIFile **pFolder, bool findIni)
-{
-  bool result = false;
-  bool    exists = false;
-  nsCOMPtr <nsIFile> eudoraPath = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
-  // look in the registry to see where eudora is installed?
-  HKEY  sKey;
-  if (::RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Qualcomm\\Eudora\\CommandLine", 0, KEY_QUERY_VALUE, &sKey) == ERROR_SUCCESS)
-  {
-    // get the value of "Current"
-    BYTE *pBytes = GetValueBytes(sKey, "Current");
-    if (pBytes)
-    {
-      nsCString str((const char *)pBytes);
-      delete [] pBytes;
-
-      MsgCompressWhitespace(str);
-
-      // Command line is Eudora mailfolder eudora.ini
-      if (findIni)
-      {
-        // find the string coming after the last space
-        int32_t index = str.RFind(" ");
-        if (index != -1)
-        {
-          index++; // skip the space
-          eudoraPath->InitWithNativePath(Substring(str, index));
-          eudoraPath->IsFile(&exists);
-          if (exists)
-            result = exists;
-          else // it may just be the mailbox location....guess that there will be a eudora.ini file there
-          {
-            eudoraPath->AppendNative(NS_LITERAL_CSTRING("eudora.ini"));
-            eudoraPath->IsFile(&exists);
-            result = exists;
-          }
-        }
-      } // if findIni
-      else
-      {
-        int  idx = -1;
-        if (str.CharAt(0) == '"')
-        {
-          idx = str.FindChar('"', 1);
-          if (idx != -1)
-            idx++;
-        }
-        else
-          idx = str.FindChar(' ');
-
-        if (idx != -1)
-        {
-          idx++;
-          while (str.CharAt(idx) == ' ') idx++;
-          int endIdx = -1;
-          if (str.CharAt(idx) == '"')
-            endIdx = str.FindChar('"', idx);
-          else {
-            endIdx = str.FindChar(' ', idx);
-            if (endIdx == -1)
-              endIdx = str.Length();
-          }
-          if (endIdx != -1)
-          {
-            eudoraPath->InitWithNativePath(Substring(str, idx, endIdx - idx));
-
-            if (NS_SUCCEEDED(eudoraPath->IsDirectory(&exists)))
-              result = exists;
-          }
-        }
-      }
-    } // if pBytes
-    ::RegCloseKey(sKey);
-  }
-
-  NS_IF_ADDREF(*pFolder = eudoraPath);
-  return result;
-}
-
-nsresult nsEudoraWin32::FindMailboxes(nsIFile *pRoot, nsIMutableArray *pArray)
-{
-  nsresult rv;
-  nsCOMPtr<nsIImportService> impSvc(do_GetService(NS_IMPORTSERVICE_CONTRACTID, &rv));
-  if (NS_FAILED(rv))
-    return rv;
-
-  m_depth = 0;
-  m_mailImportLocation = do_QueryInterface(pRoot);
-  return ScanMailDir(pRoot, pArray, impSvc);
-}
-
-
-nsresult nsEudoraWin32::ScanMailDir(nsIFile *pFolder, nsIMutableArray *pArray, nsIImportService *pImport)
-{
-  bool            exists = false;
-  bool            isFile = false;
-  char *          pContents = nullptr;
-  int32_t          len = 0;
-  nsCOMPtr<nsIFile>  descMap;
-  nsresult        rv;
-
-  if (NS_FAILED(rv = pFolder->Clone(getter_AddRefs(descMap))))
-    return rv;
-
-  m_depth++;
-
-  rv = descMap->AppendNative(NS_LITERAL_CSTRING("descmap.pce"));
-  if (NS_SUCCEEDED(rv))
-    rv = descMap->IsFile(&isFile);
-  if (NS_SUCCEEDED(rv))
-    rv = descMap->Exists(&exists);
-  if (NS_SUCCEEDED(rv) && exists && isFile)
-  {
-    nsCOMPtr<nsIInputStream> inputStream;
-    nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(inputStream), descMap);
-    if (NS_FAILED(rv))
-      return rv;
-
-    uint64_t bytesLeft64;
-    rv = inputStream->Available(&bytesLeft64);
-    if (NS_FAILED(rv))
-    {
-      IMPORT_LOG0("*** Error checking address file for eof\n");
-      inputStream->Close();
-      return rv;
-    }
-    uint32_t bytesLeft = std::min(uint64_t(PR_UINT32_MAX - 1), bytesLeft64);
-    pContents = (char *) PR_Malloc(bytesLeft + 1);
-    if (!pContents)
-      return NS_ERROR_OUT_OF_MEMORY;
-    uint32_t bytesRead;
-    rv = inputStream->Read(pContents, bytesLeft, &bytesRead);
-    if (bytesRead != bytesLeft)
-      return NS_ERROR_FAILURE;
-    pContents[bytesRead] = '\0';
-    if (NS_SUCCEEDED(rv) && pContents)
-    {
-      len = bytesRead;
-      if (NS_SUCCEEDED(rv))
-        rv = ScanDescmap(pFolder, pArray, pImport, pContents, len);
-      PR_Free(pContents);
-    }
-    else
-      rv = NS_ERROR_FAILURE;
-  }
-
-  if (NS_FAILED(rv) || !isFile || !exists)
-    rv = IterateMailDir(pFolder, pArray, pImport);
-
-  m_depth--;
-
-  return rv;
-}
-
-nsresult nsEudoraWin32::IterateMailDir(nsIFile *pFolder, nsIMutableArray *pArray, nsIImportService *pImport)
-{
-  bool hasMore;
-  nsCOMPtr<nsISimpleEnumerator> directoryEnumerator;
-  nsresult rv = pFolder->GetDirectoryEntries(getter_AddRefs(directoryEnumerator));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  directoryEnumerator->HasMoreElements(&hasMore);
-  bool              isFolder;
-  bool              isFile;
-  nsCOMPtr<nsIFile> entry;
-  nsCString         fName;
-  nsCString         ext;
-  nsCString         name;
-
-  while (hasMore && NS_SUCCEEDED(rv))
-  {
-    nsCOMPtr<nsISupports> aSupport;
-    rv = directoryEnumerator->GetNext(getter_AddRefs(aSupport));
-    nsCOMPtr<nsIFile> entry(do_QueryInterface(aSupport, &rv));
-    directoryEnumerator->HasMoreElements(&hasMore);
-
-    if (NS_SUCCEEDED(rv))
-    {
-      rv = entry->GetNativeLeafName(fName);
-      if (NS_SUCCEEDED(rv) && !fName.IsEmpty())
-      {
-        if (fName.Length() > 4)
-        {
-          ext = StringTail(fName, 4);
-          name = StringHead(fName, fName.Length() - 4);
-        }
-        else
-        {
-          ext.Truncate();
-          name = fName;
-        }
-        ToLowerCase(ext);
-        if (ext.EqualsLiteral(".fol"))
-        {
-          isFolder = false;
-          entry->IsDirectory(&isFolder);
-          if (isFolder)
-          {
-            // add the folder
-            rv = FoundMailFolder(entry, name.get(), pArray, pImport);
-            if (NS_SUCCEEDED(rv))
-            {
-              rv = ScanMailDir(entry, pArray, pImport);
-              if (NS_FAILED(rv))
-                IMPORT_LOG0("*** Error scanning mail directory\n");
-            }
-          }
-        }
-        else if (ext.EqualsLiteral(".mbx"))
-        {
-          isFile = false;
-          entry->IsFile(&isFile);
-          if (isFile)
-            rv = FoundMailbox(entry, name.get(), pArray, pImport);
-        }
-      }
-    }
-  }
-  return rv;
-}
-
-nsresult nsEudoraWin32::ScanDescmap(nsIFile *pFolder, nsIMutableArray *pArray, nsIImportService *pImport, const char *pData, int32_t len)
-{
-  // use this to find stuff in the directory.
-
-  nsCOMPtr<nsIFile>  entry;
-  nsresult        rv;
-
-  if (NS_FAILED(rv = pFolder->Clone(getter_AddRefs(entry))))
-    return rv;
-  entry->AppendNative(NS_LITERAL_CSTRING("dummy"));
-  // format is Name,FileName,Type,Flag?
-  //  Type = M or S for mailbox
-  //       = F for folder
-
-  int32_t      fieldLen;
-  int32_t      pos = 0;
-  const char * pStart;
-  nsCString    name;
-  nsCString    fName;
-  nsCString    type;
-  nsCString    flag;
-  bool         isFile;
-  bool         isFolder;
-  while (pos < len)
-  {
-    pStart = pData;
-    fieldLen = 0;
-    while ((pos < len) && (*pData != ','))
-    {
-      pos++;
-      pData++;
-      fieldLen++;
-    }
-    name.Truncate();
-    if (fieldLen)
-      name.Append(pStart, fieldLen);
-    name.Trim(kWhitespace);
-    pos++;
-    pData++;
-    pStart = pData;
-    fieldLen = 0;
-    while ((pos < len) && (*pData != ','))
-    {
-      pos++;
-      pData++;
-      fieldLen++;
-    }
-    fName.Truncate();
-    if (fieldLen)
-      fName.Append(pStart, fieldLen);
-    // Descmap file name is written without any extraneous white space - i.e.
-    // if there's whitespace present it's intentional and important. Don't
-    // strip whitespace from the fName.
-    pos++;
-    pData++;
-    pStart = pData;
-    fieldLen = 0;
-    while ((pos < len) && (*pData != ','))
-    {
-      pos++;
-      pData++;
-      fieldLen++;
-    }
-    type.Truncate();
-    if (fieldLen)
-      type.Append(pStart, fieldLen);
-    type.Trim(kWhitespace);
-    pos++;
-    pData++;
-    pStart = pData;
-    fieldLen = 0;
-    // Skip to next end of line, or ',' separator.
-    while ((pos < len) &&
-           (*pData != nsCRT::CR) && (*pData != nsCRT::LF) && (*pData != ','))
-    {
-      pos++;
-      pData++;
-      fieldLen++;
-    }
-    flag.Truncate();
-    if (fieldLen)
-      flag.Append(pStart, fieldLen);
-    flag.Trim(kWhitespace);
-    // Skip over end of line(s).
-    while ((pos < len) && ((*pData == nsCRT::CR) || (*pData == nsCRT::LF)))
-    {
-      pos++;
-      pData++;
-    }
-
-    IMPORT_LOG2("name: %s, fName: %s\n", name.get(), fName.get());
-
-    if (!fName.IsEmpty() && !name.IsEmpty() && (type.Length() == 1))
-    {
-      rv = entry->SetNativeLeafName(fName);
-      if (NS_SUCCEEDED(rv))
-      {
-        if (type.CharAt(0) == 'F')
-        {
-          isFolder = false;
-          entry->IsDirectory(&isFolder);
-          if (isFolder)
-          {
-            rv = FoundMailFolder(entry, name.get(), pArray, pImport);
-            if (NS_SUCCEEDED(rv))
-            {
-              rv = ScanMailDir(entry, pArray, pImport);
-              if (NS_FAILED(rv))
-                IMPORT_LOG0("*** Error scanning mail directory\n");
-            }
-          }
-        }
-        else if ((type.CharAt(0) == 'M') || (type.CharAt(0) == 'S'))
-        {
-          isFile = false;
-          entry->IsFile(&isFile);
-          if (isFile)
-            FoundMailbox(entry, name.get(), pArray, pImport);
-        }
-      }
-    }
-  }
-
-  return NS_OK;
-}
-
-
-nsresult nsEudoraWin32::FoundMailbox(nsIFile *mailFile, const char *pName, nsIMutableArray *pArray, nsIImportService *pImport)
-{
-  nsString displayName;
-  nsCOMPtr<nsIImportMailboxDescriptor> desc;
-  nsISupports * pInterface;
-
-  NS_CopyNativeToUnicode(nsDependentCString(pName), displayName);
-
-#ifdef IMPORT_DEBUG
-  nsAutoCString path;
-  mailFile->GetNativePath(path);
-  if (!path.IsEmpty())
-    IMPORT_LOG2("Found eudora mailbox, %s: %s\n", path.get(), pName);
-  else
-    IMPORT_LOG1("Found eudora mailbox, %s\n", pName);
-  IMPORT_LOG1("\tm_depth = %d\n", (int)m_depth);
-#endif
-
-  nsresult rv = pImport->CreateNewMailboxDescriptor(getter_AddRefs(desc));
-  if (NS_SUCCEEDED(rv))
-  {
-    int64_t sz = 0;
-    mailFile->GetFileSize(&sz);
-    desc->SetDisplayName(displayName.get());
-    desc->SetDepth(m_depth);
-    desc->SetSize(sz);
-    nsCOMPtr <nsIFile> pFile = nullptr;
-    desc->GetFile(getter_AddRefs(pFile));
-    if (pFile)
-    {
-      pFile->InitWithFile(mailFile);
-    }
-    rv = desc->QueryInterface(kISupportsIID, (void **) &pInterface);
-    pArray->AppendElement(pInterface, false);
-    pInterface->Release();
-  }
-
-  return NS_OK;
-}
-
-
-nsresult nsEudoraWin32::FoundMailFolder(nsIFile *mailFolder, const char *pName, nsIMutableArray *pArray, nsIImportService *pImport)
-{
-  nsString                displayName;
-  nsCOMPtr<nsIImportMailboxDescriptor>  desc;
-  nsISupports *              pInterface;
-
-  NS_CopyNativeToUnicode(nsDependentCString(pName), displayName);
-
-#ifdef IMPORT_DEBUG
-  nsAutoCString path;
-  mailFolder->GetNativePath(path);
-  if (!path.IsEmpty())
-    IMPORT_LOG2("Found eudora folder, %s: %s\n", path.get(), pName);
-  else
-    IMPORT_LOG1("Found eudora folder, %s\n", pName);
-  IMPORT_LOG1("\tm_depth = %d\n", (int)m_depth);
-#endif
-
-  nsresult rv = pImport->CreateNewMailboxDescriptor(getter_AddRefs(desc));
-  if (NS_SUCCEEDED(rv))
-  {
-    uint32_t    sz = 0;
-    desc->SetDisplayName(displayName.get());
-    desc->SetDepth(m_depth);
-    desc->SetSize(sz);
-    nsCOMPtr <nsIFile> pFile = nullptr;
-    desc->GetFile(getter_AddRefs(pFile));
-    if (pFile)
-    {
-      pFile->InitWithFile(mailFolder);
-    }
-    rv = desc->QueryInterface(kISupportsIID, (void **) &pInterface);
-    pArray->AppendElement(pInterface, false);
-    pInterface->Release();
-  }
-
-  return NS_OK;
-}
-
-
-nsresult nsEudoraWin32::FindTOCFile(nsIFile *pMailFile, nsIFile **ppTOCFile, bool *pDeleteToc)
-{
-  nsresult    rv;
-  nsAutoCString  leaf;
-
-  *pDeleteToc = false;
-  *ppTOCFile = nullptr;
-  rv = pMailFile->GetNativeLeafName(leaf);
-  if (NS_FAILED(rv))
-    return rv;
-  rv = pMailFile->GetParent(ppTOCFile);
-  if (NS_FAILED(rv))
-    return rv;
-
-  nsCString  name;
-  if ((leaf.Length() > 4) && (leaf.CharAt(leaf.Length() - 4) == '.'))
-    name = StringHead(leaf, leaf.Length() - 4);
-  else
-    name = leaf;
-  name.Append(".toc");
-  rv = (*ppTOCFile)->AppendNative(name);
-  if (NS_FAILED(rv))
-    return rv;
-
-  bool    exists = false;
-  rv = (*ppTOCFile)->Exists(&exists);
-  if (NS_FAILED(rv))
-    return rv;
-  bool    isFile = false;
-  rv = (*ppTOCFile)->IsFile(&isFile);
-  if (NS_FAILED(rv))
-    return rv;
-  if (exists && isFile)
-    return NS_OK;
-
-  return NS_ERROR_FAILURE;
-}
-
-
-bool nsEudoraWin32::ImportSettings(nsIFile *pIniFile, nsIMsgAccount **localMailAccount)
-{
-  bool      result = false;
-  nsresult  rv;
-
-  nsCOMPtr<nsIMsgAccountManager> accMgr =
-           do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
-  if (NS_FAILED(rv))
-  {
-    IMPORT_LOG0("*** Failed to create a account manager!\n");
-    return false;
-  }
-
-  // Eudora info is arranged by key, 1 for the default, then persona's for additional
-  // accounts.
-  // Start with the first one, then do each persona
-  nsCString iniPath;
-  pIniFile->GetNativePath(iniPath);
-  if (iniPath.IsEmpty())
-    return false;
-  UINT       valInt;
-  SimpleBufferTonyRCopiedOnce  section;
-  DWORD      sSize;
-  DWORD      sOffset = 0;
-  DWORD      start;
-  nsCString  sectionName("Settings");
-  int        popCount = 0;
-  int        accounts = 0;
-
-  DWORD  allocSize = 0;
-  do
-  {
-    allocSize += 2048;
-    section.Allocate(allocSize);
-    sSize = ::GetPrivateProfileSection("Personalities", section.m_pBuffer, allocSize, iniPath.get());
-  } while (sSize == (allocSize - 2));
-
-  nsIMsgAccount *  pAccount;
-
-  do
-  {
-    if (!sectionName.IsEmpty())
-    {
-      pAccount = nullptr;
-      valInt = ::GetPrivateProfileInt(sectionName.get(), "UsesPOP", 1, iniPath.get());
-      if (valInt)
-      {
-        // This is a POP account
-        if (BuildPOPAccount(accMgr, sectionName.get(), iniPath.get(), &pAccount))
-        {
-          accounts++;
-          popCount++;
-          if (popCount > 1)
-          {
-            if (localMailAccount && *localMailAccount)
-              NS_RELEASE(*localMailAccount);
-          }
-          else if (localMailAccount)
-          {
-            *localMailAccount = pAccount;
-            NS_IF_ADDREF(pAccount);
-          }
-        }
-      }
-      else
-      {
-        valInt = ::GetPrivateProfileInt(sectionName.get(), "UsesIMAP", 0, iniPath.get());
-        if (valInt)
-        {
-          // This is an IMAP account
-          if (BuildIMAPAccount(accMgr, sectionName.get(), iniPath.get(), &pAccount))
-            accounts++;
-        }
-      }
-      if (pAccount && (sOffset == 0))
-        accMgr->SetDefaultAccount(pAccount);
-
-      NS_IF_RELEASE(pAccount);
-    }
-
-    sectionName.Truncate();
-    while ((sOffset < sSize) && (section.m_pBuffer[sOffset] != '='))
-      sOffset++;
-    sOffset++;
-    start = sOffset;
-    while ((sOffset < sSize) && (section.m_pBuffer[sOffset] != 0))
-      sOffset++;
-    if (sOffset > start)
-    {
-      sectionName.Append(section.m_pBuffer + start, sOffset - start);
-      sectionName.Trim(kWhitespace);
-    }
-
-  } while (sOffset < sSize);
-
-  // Now save the new acct info to pref file.
-  rv = accMgr->SaveAccountInfo();
-  NS_ASSERTION(NS_SUCCEEDED(rv), "Can't save account info to pref file");
-
-
-  return accounts != 0;
-}
-
-bool nsEudoraWin32::FindFiltersFile(nsIFile **pFiltersFile)
-{
-  bool result = FindEudoraLocation(pFiltersFile, false);
-
-  if (result)
-  {
-    (*pFiltersFile)->AppendNative(NS_LITERAL_CSTRING("Filters.pce"));
-    (*pFiltersFile)->IsFile(&result);
-  }
-
-  return result;
-}
-
-bool nsEudoraWin32::GetMailboxNameHierarchy(const nsACString& pEudoraLocation, const char* pEudoraFilePath, nsCString& nameHierarchy)
-{
-  if (pEudoraLocation.IsEmpty() || !pEudoraFilePath || !*pEudoraFilePath)
-    return false;
-
-  nsresult rv;
-  nsCOMPtr <nsIFile> descMap = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
-
-  rv = descMap->InitWithNativePath(pEudoraLocation);
-  NS_ENSURE_SUCCESS(rv, false);
-  rv = descMap->AppendNative(NS_LITERAL_CSTRING("descmap.pce"));
-  NS_ENSURE_SUCCESS(rv, false);
-
-  nsCOMPtr <nsIInputStream> inputStream;
-  rv = NS_NewLocalFileInputStream(getter_AddRefs(inputStream), descMap);
-  NS_ENSURE_SUCCESS(rv, false);
-
-  nsCOMPtr<nsILineInputStream> lineStream(do_QueryInterface(inputStream, &rv));
-  NS_ENSURE_SUCCESS(rv, false);
-
-  int32_t pathLength;
-  const char* backslash = strchr(pEudoraFilePath, '\\');
-  if (backslash)
-    pathLength = backslash - pEudoraFilePath;
-  else
-    pathLength = strlen(pEudoraFilePath);
-
-  bool more = true;
-  nsAutoCString buf;
-  while (more)
-  {
-    rv = lineStream->ReadLine(buf, &more);
-    NS_ENSURE_SUCCESS(rv, false);
-
-    int32_t iNameEnd = buf.FindChar(',');
-    if (iNameEnd < 0)
-      continue;
-    const nsACString& name = Substring(buf, 0, iNameEnd);
-    int32_t iPathEnd = buf.FindChar(',', iNameEnd + 1);
-    if (iPathEnd < 0)
-      continue;
-    const nsACString& path = Substring(buf, iNameEnd + 1, iPathEnd - iNameEnd - 1);
-    const char type = buf[iPathEnd + 1];
-    if (strnicmp(path.BeginReading(), pEudoraFilePath, pathLength) == 0 && path.Length() == pathLength)
-    {
-      nameHierarchy += "\\";
-      nameHierarchy += name;
-      if (pEudoraFilePath[pathLength] == 0)
-        return true;
-      if (type != 'F')
-      {
-        // Something went wrong.  We've matched a mailbox, but the
-        // hierarchical name says we've got more folders to traverse.
-        return false;
-      }
-
-      nsCString newLocation(pEudoraLocation);
-      newLocation += '\\';
-      newLocation += path;
-      return GetMailboxNameHierarchy(newLocation, pEudoraFilePath + pathLength + 1, nameHierarchy);
-    }
-  }
-
-  return false;
-}
-
-// maximium size of settings strings
-#define  kIniValueSize    384
-
-
-void nsEudoraWin32::GetServerAndUserName(const char *pSection, const char *pIni, nsCString& serverName, nsCString& userName, char *pBuff)
-{
-  DWORD    valSize;
-  int      idx;
-  nsCString  tStr;
-
-  serverName.Truncate();
-  userName.Truncate();
-
-  valSize = ::GetPrivateProfileString(pSection, "PopServer", "", pBuff, kIniValueSize, pIni);
-  if (valSize)
-    serverName = pBuff;
-  else
-  {
-    valSize = ::GetPrivateProfileString(pSection, "POPAccount", "", pBuff, kIniValueSize, pIni);
-    if (valSize)
-    {
-      serverName = pBuff;
-      idx = serverName.FindChar('@');
-      if (idx != -1)
-        serverName = Substring(serverName, idx + 1);
-    }
-  }
-  valSize = ::GetPrivateProfileString(pSection, "LoginName", "", pBuff, kIniValueSize, pIni);
-  if (valSize)
-    userName = pBuff;
-  else
-  {
-    valSize = ::GetPrivateProfileString(pSection, "POPAccount", "", pBuff, kIniValueSize, pIni);
-    if (valSize)
-    {
-      userName = pBuff;
-      idx = userName.FindChar('@');
-      if (idx != -1)
-        userName.SetLength(idx);
-    }
-  }
-}
-
-void nsEudoraWin32::GetAccountName(const char *pSection, nsString& str)
-{
-  str.Truncate();
-
-  nsCString s(pSection);
-
-  if (s.LowerCaseEqualsLiteral("settings"))
-  {
-    str.AssignLiteral("Eudora ");
-    str.Append(NS_ConvertASCIItoUTF16(pSection));
-  }
-  else
-  {
-    str.AssignASCII(pSection);
-    if (StringBeginsWith(s, NS_LITERAL_CSTRING("persona-"), nsCaseInsensitiveCStringComparator()))
-      CopyASCIItoUTF16(Substring(s, 8), str);
-  }
-}
-
-
-bool nsEudoraWin32::BuildPOPAccount(nsIMsgAccountManager *accMgr, const char *pSection, const char *pIni, nsIMsgAccount **ppAccount)
-{
-  if (ppAccount)
-    *ppAccount = nullptr;
-
-  char valBuff[kIniValueSize];
-  nsCString serverName;
-  nsCString userName;
-
-  GetServerAndUserName(pSection, pIni, serverName, userName, valBuff);
-
-  if (serverName.IsEmpty() || userName.IsEmpty())
-    return false;
-
-  bool result = false;
-
-  // I now have a user name/server name pair, find out if it already exists?
-  nsCOMPtr<nsIMsgIncomingServer> in;
-  nsresult rv = accMgr->FindServer(userName, serverName, NS_LITERAL_CSTRING("pop3"), getter_AddRefs(in));
-  if (NS_FAILED(rv) || !in)
-  {
-    // Create the incoming server and an account for it?
-    rv = accMgr->CreateIncomingServer(userName, serverName, NS_LITERAL_CSTRING("pop3"), getter_AddRefs(in));
-    if (NS_SUCCEEDED(rv) && in)
-    {
-      rv = in->SetType(NS_LITERAL_CSTRING("pop3"));
-      // rv = in->SetHostName(serverName);
-      // rv = in->SetUsername(userName);
-
-      IMPORT_LOG2("Created POP3 server named: %s, userName: %s\n", serverName.get(), userName.get());
-
-      nsString prettyName;
-      GetAccountName(pSection, prettyName);
-      IMPORT_LOG1("\tSet pretty name to: %S\n", prettyName.get());
-      rv = in->SetPrettyName(prettyName);
-
-      // We have a server, create an account.
-      nsCOMPtr<nsIMsgAccount>  account;
-      rv = accMgr->CreateAccount(getter_AddRefs(account));
-      if (NS_SUCCEEDED(rv) && account)
-      {
-        rv = account->SetIncomingServer(in);
-
-        IMPORT_LOG0("Created a new account and set the incoming server to the POP3 server.\n");
-
-        nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(in, &rv);
-        NS_ENSURE_SUCCESS(rv,false);
-        UINT valInt = ::GetPrivateProfileInt(pSection, "LeaveMailOnServer", 0, pIni);
-        pop3Server->SetLeaveMessagesOnServer(valInt ? true : false);
-
-        // Fiddle with the identities
-        SetIdentities(accMgr, account, pSection, pIni, userName.get(), serverName.get(), valBuff);
-        result = true;
-        if (ppAccount)
-          account->QueryInterface(NS_GET_IID(nsIMsgAccount), (void **)ppAccount);
-      }
-    }
-  }
-  else
-    result = true;
-
-  return result;
-}
-
-bool nsEudoraWin32::BuildIMAPAccount(nsIMsgAccountManager *accMgr, const char *pSection, const char *pIni, nsIMsgAccount **ppAccount)
-{
-  char valBuff[kIniValueSize];
-  nsCString serverName;
-  nsCString userName;
-
-  GetServerAndUserName(pSection, pIni, serverName, userName, valBuff);
-
-  if (serverName.IsEmpty() || userName.IsEmpty())
-    return false;
-
-  bool result = false;
-
-  nsCOMPtr<nsIMsgIncomingServer> in;
-  nsresult rv = accMgr->FindServer(userName, serverName, NS_LITERAL_CSTRING("imap"), getter_AddRefs(in));
-  if (NS_FAILED(rv) || (in == nullptr))
-  {
-    // Create the incoming server and an account for it?
-    rv = accMgr->CreateIncomingServer(userName, serverName, NS_LITERAL_CSTRING("imap"), getter_AddRefs(in));
-    if (NS_SUCCEEDED(rv) && in)
-    {
-      rv = in->SetType(NS_LITERAL_CSTRING("imap"));
-      // rv = in->SetHostName(serverName);
-      // rv = in->SetUsername(userName);
-
-      IMPORT_LOG2("Created IMAP server named: %s, userName: %s\n", serverName.get(), userName.get());
-
-      nsString prettyName;
-      GetAccountName(pSection, prettyName);
-      IMPORT_LOG1("\tSet pretty name to: %S\n", prettyName.get());
-      rv = in->SetPrettyName(prettyName);
-
-      // We have a server, create an account.
-      nsCOMPtr<nsIMsgAccount> account;
-      rv = accMgr->CreateAccount(getter_AddRefs(account));
-      if (NS_SUCCEEDED(rv) && account)
-      {
-        rv = account->SetIncomingServer(in);
-
-        IMPORT_LOG0("Created an account and set the IMAP server as the incoming server\n");
-
-        // Fiddle with the identities
-        SetIdentities(accMgr, account, pSection, pIni, userName.get(), serverName.get(), valBuff);
-        result = true;
-        if (ppAccount)
-          account->QueryInterface(NS_GET_IID(nsIMsgAccount), (void **)ppAccount);
-      }
-    }
-  }
-  else
-    result = true;
-
-  return result;
-}
-
-void nsEudoraWin32::SetIdentities(nsIMsgAccountManager *accMgr, nsIMsgAccount *acc, const char *pSection, const char *pIniFile, const char *userName, const char *serverName, char *pBuff)
-{
-  nsAutoCString realName;
-  nsAutoCString email;
-  nsAutoCString server;
-  DWORD valSize;
-  nsresult rv;
-
-  valSize = ::GetPrivateProfileString(pSection, "RealName", "", pBuff, kIniValueSize, pIniFile);
-  if (valSize)
-    realName = pBuff;
-  valSize = ::GetPrivateProfileString(pSection, "SMTPServer", "", pBuff, kIniValueSize, pIniFile);
-  if (valSize)
-    server = pBuff;
-  valSize = ::GetPrivateProfileString(pSection, "ReturnAddress", "", pBuff, kIniValueSize, pIniFile);
-  if (valSize)
-    email = pBuff;
-
-  nsCOMPtr<nsIMsgIdentity> id;
-  rv = accMgr->CreateIdentity(getter_AddRefs(id));
-  if (id)
-  {
-    nsAutoString fullName;
-    fullName.Assign(NS_ConvertASCIItoUTF16(realName));
-    id->SetFullName(fullName);
-    id->SetIdentityName(fullName);
-    if (email.IsEmpty())
-    {
-      email = userName;
-      email += "@";
-      email += serverName;
-    }
-    id->SetEmail(email);
-    acc->AddIdentity(id);
-
-    IMPORT_LOG0("Created identity and added to the account\n");
-    IMPORT_LOG1("\tname: %s\n", realName.get());
-    IMPORT_LOG1("\temail: %s\n", email.get());
-  }
-  SetSmtpServer(accMgr, acc, server.get(), userName);
-}
-
-
-void nsEudoraWin32::SetSmtpServer(nsIMsgAccountManager *pMgr, nsIMsgAccount *pAcc, const char *pServer, const char *pUser)
-{
-  nsresult  rv;
-
-  nsCOMPtr<nsISmtpService> smtpService(do_GetService(NS_SMTPSERVICE_CONTRACTID, &rv));
-  if (NS_SUCCEEDED(rv) && smtpService)
-  {
-    nsCOMPtr<nsISmtpServer>    foundServer;
-
-    rv = smtpService->FindServer(pUser, pServer, getter_AddRefs(foundServer));
-    if (NS_SUCCEEDED(rv) && foundServer)
-    {
-      IMPORT_LOG1("SMTP server already exists: %s\n", pServer);
-      return;
-    }
-    nsCOMPtr<nsISmtpServer>    smtpServer;
-
-    rv = smtpService->CreateServer(getter_AddRefs(smtpServer));
-    if (NS_SUCCEEDED(rv) && smtpServer)
-    {
-      smtpServer->SetHostname(nsDependentCString(pServer));
-      if (pUser)
-        smtpServer->SetUsername(nsDependentCString(pUser));
-
-      IMPORT_LOG1("Created new SMTP server: %s\n", pServer);
-    }
-  }
-}
-
-nsresult nsEudoraWin32::GetAttachmentInfo(const char *pFileName, nsIFile *pFile, nsCString& mimeType, nsCString& aAttachmentName)
-{
-  nsresult  rv;
-  mimeType.Truncate();
-  pFile->InitWithNativePath(nsDependentCString(pFileName));
-  bool      isFile = false;
-  bool      exists = false;
-  if (NS_FAILED(rv = pFile->Exists(&exists)))
-    return rv;
-  if (exists && NS_FAILED(rv = pFile->IsFile(&isFile)))
-    return rv;
-
-  if (!exists || !isFile)
-  {
-    // Windows Eudora writes the full path to the attachment when the message
-    // is received, but doesn't update that path if the attachment directory
-    // changes (e.g. if email directory is moved). When operating on an
-    // attachment (opening, etc.) Eudora will first check the full path
-    // and then if the file doesn't exist there Eudora will check the
-    // current attachment directory for a file with the same name.
-    //
-    // Check to see if we have any better luck looking for the attachment
-    // in the current attachment directory.
-    nsAutoCString name;
-    pFile->GetNativeLeafName(name);
-    if (name.IsEmpty())
-      return NS_ERROR_FAILURE;
-
-    nsCOMPtr <nsIFile> altFile;
-    rv = m_mailImportLocation->Clone(getter_AddRefs(altFile));
-    NS_ENSURE_SUCCESS(rv, rv);
-    // For now, we'll do that using a hard coded name and location for the
-    // attachment directory on Windows (the default location) "attach" inside
-    // of the Eudora mail directory. Once settings from Eudora are imported
-    // better, we'll want to check where the settings say attachments are stored.
-    altFile->AppendNative(NS_LITERAL_CSTRING("attach"));
-    altFile->AppendNative(name);
-
-    // Did we come up with a different path or was the original path already
-    // in the current attachment directory?
-    bool    isSamePath = true;
-    rv = altFile->Equals(pFile, &isSamePath);
-
-    if (NS_SUCCEEDED(rv) && !isSamePath)
-    {
-      // We came up with a different path - check the new path.
-      if (NS_FAILED(rv = altFile->Exists(&exists)))
-        return rv;
-      if (exists && NS_FAILED(rv = altFile->IsFile(&isFile)))
-        return rv;
-
-      // Keep the new path if it helped us.
-      if (exists && isFile)
-      {
-        nsCString   nativePath;
-        altFile->GetNativePath(nativePath);
-        pFile->InitWithNativePath(nativePath);
-      }
-    }
-  }
-
-  if (exists && isFile)
-  {
-    nsAutoCString name;
-    pFile->GetNativeLeafName(name);
-    if (name.IsEmpty())
-      return NS_ERROR_FAILURE;
-    if (name.Length() > 4)
-    {
-      nsCString ext;
-