printf("sorry, migration of movemail not supported yet.\n"); NS_ASSERTION(0, "movemail migration not supported yet."); return NS_ERROR_UNEXPECTED;
rv = MigrateMovemailAccount(identity); if (NS_FAILED(rv)) return rv;   rv = CreateLocalMailAccount(identity); if (NS_FAILED(rv)) return rv;
nsMsgAccountManager::UpgradePrefs(){    nsresult rv;    PRInt32 oldMailType;    rv = getPrefService();    if (NS_FAILED(rv)) return rv;    rv = m_prefs->GetIntPref(PREF_4X_MAIL_SERVER_TYPE, &oldMailType);    if (NS_FAILED(rv)) {#ifdef DEBUG_ACCOUNTMANAGER        printf("Tried to upgrade old prefs, but couldn't find server type!\n");#endif        return rv;    }    // because mail.server_type defaults to 0 (pop) it will look the user    // has something to migrate, even with an empty prefs.js file    // ProceedWithMigration will check if there is something to migrate    // if not, NS_FAILED(rv) will be true, and we'll return.    // this plays nicely with msgMail3PaneWindow.js, which will launch the    // Account Manager if UpgradePrefs() fails.    rv = ProceedWithMigration(oldMailType);    if (NS_FAILED(rv)) {#ifdef DEBUG_ACCOUNTMANAGER      printf("FAIL:  don't proceed with migration.\n");#endif      // but before we do that, create the default Local Mail Account      rv = CreateLocalMailAccount(nsnull /* no identity yet */);      NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create the Local Mail account");      // return NS_ERROR_FAILURE because we failed to upgrade the pref.js      // by returning a failure code, this will case the Account Wizard      // to be automatically opened.      return NS_ERROR_FAILURE;    }#ifdef DEBUG_ACCOUNTMANAGER    else {        printf("PASS:  proceed with migration.\n");    }#endif     // create a dummy identity, for migration only    nsCOMPtr<nsIMsgIdentity> identity;    rv = createKeyedIdentity("migration", getter_AddRefs(identity));    if (NS_FAILED(rv)) return rv;    rv = MigrateIdentity(identity);    if (NS_FAILED(rv)) return rv;            nsCOMPtr<nsISmtpServer> smtpServer;    NS_WITH_SERVICE(nsISmtpService, smtpService, kSmtpServiceCID, &rv);    if (NS_FAILED(rv)) return rv;        rv = smtpService->GetDefaultServer(getter_AddRefs(smtpServer));    if (NS_FAILED(rv)) return rv;        rv = MigrateSmtpServer(smtpServer);    if (NS_FAILED(rv)) return rv;        if ( oldMailType == POP_4X_MAIL_TYPE) {      // in 4.x, you could only have one pop account      rv = MigratePopAccount(identity);      if (NS_FAILED(rv)) return rv;      // you got to have one, so we just create it here.      rv = CreateLocalMailAccount(identity);      if (NS_FAILED(rv)) return rv;	}    else if (oldMailType == IMAP_4X_MAIL_TYPE) {      rv = MigrateImapAccounts(identity);      if (NS_FAILED(rv)) return rv;            // if they had IMAP, they also had one "Local Mail"      // we need to migrate that, too.        rv = MigrateLocalMailAccount(identity);      if (NS_FAILED(rv)) return rv;	}    else if (oldMailType == MOVEMAIL_4X_MAIL_TYPE) {      printf("sorry, migration of movemail not supported yet.\n");      NS_ASSERTION(0, "movemail migration not supported yet.");      return NS_ERROR_UNEXPECTED;    }    else {#ifdef DEBUG_ACCOUNTMANAGER      printf("Unrecognized server type %d\n", oldMailType);#endif      return NS_ERROR_UNEXPECTED;    }    rv = MigrateNewsAccounts(identity);    if (NS_FAILED(rv)) return rv;    // we're done migrating, let's save the prefs    rv = m_prefs->SavePrefFile();    if (NS_FAILED(rv)) return rv;    // XXX TODO: remove dummy migration identity    return NS_OK;}