server->SetCanDelete(PR_TRUE);
PRBool nsImportGenericMail::GetAccount( nsIMsgFolder **ppFolder){	nsresult	rv;		*ppFolder = nsnull;			NS_WITH_SERVICE( nsIMsgAccountManager, accMgr, kMsgAccountMgrCID, &rv);    if (NS_FAILED(rv)) {		IMPORT_LOG0( "*** Failed to create a account manager!\n");		return( PR_FALSE);	}	// Create a new account for the import	// TODO: Ensure that the named used for this server is unique.	// Get the default name from the import module.	nsString	prettyName;	if (m_pName)		prettyName = m_pName;	else		prettyName.AssignWithConversion("Imported Mail");		nsCOMPtr<nsIMsgIncomingServer> server;	// Let's find a host name we're not using yet for a new "none" server	int		count = 1;	char	hostName[30];	PR_snprintf( hostName, 30, "%s", "imported.mail");	while (count < 1000) {		rv = accMgr->FindServer( "import", hostName, "none", getter_AddRefs( server));		if (NS_SUCCEEDED( rv)) {			PR_snprintf( hostName, 30, "imported%d.mail", count);			count++;		}		else			break;	}		if (NS_SUCCEEDED( rv)) {		IMPORT_LOG0( "*** Failed to find a unique 'none' server to create for importing\n");		return( PR_FALSE);	}		rv = accMgr->CreateIncomingServer( "import", hostName, "none", getter_AddRefs( server));	if (NS_FAILED( rv)) {		IMPORT_LOG0( "*** Failed to create a 'none' incoming server\n");		return( PR_FALSE);	}	server->SetType( "none");	// Let's get a reasonable "pretty name" that doesn't exist yet?	GetUniquePrettyName( accMgr, prettyName);		server->SetPrettyName( (PRUnichar *) prettyName.GetUnicode());	// server->SetHostName( hostName);	// server->SetUsername( "import");  		// create a new account with the server and identity.	nsCOMPtr<nsIMsgAccount>	account;	rv = accMgr->CreateAccount( getter_AddRefs( account));	if (NS_FAILED( rv)) {		IMPORT_LOG0( "*** Error creating new account\n");		return( PR_FALSE);	}		rv = account->SetIncomingServer( server);		if (NS_FAILED( rv)) {		IMPORT_LOG0( "*** Error setting incoming server on account\n");	}	nsCOMPtr<nsIFolder>	rootFolder;	rv = server->GetRootFolder( getter_AddRefs( rootFolder));	if (NS_SUCCEEDED( rv) && (rootFolder != nsnull)) {		rv = rootFolder->QueryInterface( NS_GET_IID(nsIMsgFolder), (void **)ppFolder);		if (NS_SUCCEEDED( rv)) {			IMPORT_LOG0( "****** CREATED NEW ACCOUNT FOR IMPORT\n");			return( PR_TRUE);		}	}				IMPORT_LOG0( "****** FAILED TO CREATE NEW ACCOUNT FOR IMPORT\n");	return( PR_FALSE);}