if (server->dirType == PABDirectory)
if (server->dirType == PABDirectory || server->dirType == MAPIDirectory)
void DIR_SavePrefsForOneServer(DIR_Server *server){	char *prefstring;	char tempstring[256];	char * csidAsString = nsnull;	if (server->prefName == nsnull)		server->prefName = DIR_CreateServerPrefName (server, nsnull);	prefstring = server->prefName;	DIR_SetFlag(server, DIR_SAVING_SERVER);	DIR_SetIntPref (prefstring, "position", tempstring, server->position, kDefaultPosition);	// Only save the non-default address book name	if (0 != PL_strcmp(prefstring, "ldap_2.servers.pab") &&		0 != PL_strcmp(prefstring, "ldap_2.servers.history")) 		DIR_SetStringPref (prefstring, "description", tempstring, server->description, "");	DIR_SetStringPref (prefstring, "serverName", tempstring, server->serverName, "");	DIR_SetStringPref (prefstring, "searchBase", tempstring, server->searchBase, "");	DIR_SetStringPref (prefstring, "filename", tempstring, server->fileName, "");	if (server->port == 0)		server->port = server->isSecure ? LDAPS_PORT : LDAP_PORT;	DIR_SetIntPref (prefstring, "port", tempstring, server->port, server->isSecure ? LDAPS_PORT : LDAP_PORT);	DIR_SetIntPref (prefstring, "maxHits", tempstring, server->maxHits, kDefaultMaxHits);	DIR_SetBoolPref (prefstring, "isSecure", tempstring, server->isSecure, PR_FALSE);	DIR_SetBoolPref (prefstring, "saveResults", tempstring, server->saveResults, PR_TRUE);	DIR_SetBoolPref (prefstring, "efficientWildcards", tempstring, server->efficientWildcards, PR_TRUE);	DIR_SetStringPref (prefstring, "searchString", tempstring, server->lastSearchString, "");	DIR_SetIntPref (prefstring, "dirType", tempstring, server->dirType, LDAPDirectory);	DIR_SetBoolPref (prefstring, "isOffline", tempstring, server->isOffline, kDefaultIsOffline);  if (server->dirType == LDAPDirectory)      DIR_SetStringPref(prefstring, "uri", tempstring, server->uri, "");	/* save the column attributes */	if (server->dirType == PABDirectory)		DIR_SetStringPref(prefstring, "columns", tempstring, server->columnAttributes, kDefaultPABColumnHeaders);	else		DIR_SetStringPref(prefstring, "columns", tempstring, server->columnAttributes, kDefaultLDAPColumnHeaders);	DIR_SetBoolPref (prefstring, "autoComplete.enabled", tempstring, DIR_TestFlag(server, DIR_AUTO_COMPLETE_ENABLED), kDefaultAutoCompleteEnabled);	DIR_SetStringPref (prefstring, "autoComplete.filter", tempstring, server->autoCompleteFilter, nsnull);	DIR_SetBoolPref (prefstring, "autoComplete.never", tempstring, DIR_TestFlag(server, DIR_AUTO_COMPLETE_NEVER), kDefaultAutoCompleteNever);	/* save the I18N information for the directory */		/* I18N folks want us to save out the csid as a string.....*//*	csidAsString = (char *) INTL_CsidToCharsetNamePt(server->csid);*/ /* this string is actually static we should not free it!!! */	csidAsString = NULL; /* this string is actually static we should not free it!!! */	if (csidAsString)		DIR_SetStringPref(prefstring, "csid", tempstring, csidAsString, nsnull);		/* since we are no longer writing out the csid as an integer, make sure that preference is removed.	   kDefaultPABCSID is a bogus csid value that when we read back in we can recognize as an outdated pref */	/* this is dirty but it works...this is how we assemble the pref name in all of the DIR_SetString/bool/intPref functions */	PL_strcpy(tempstring, prefstring);	PL_strcat(tempstring, ".");	PL_strcat(tempstring, "charset");	DIR_ClearIntPref(tempstring);  /* now clear the pref */	/* now save the locale string */	DIR_SetStringPref(prefstring, "locale", tempstring, server->locale, nsnull);	/* Save authentication prefs */	DIR_SetBoolPref (prefstring, "auth.enabled", tempstring, server->enableAuth, kDefaultEnableAuth);	DIR_SetBoolPref (prefstring, "auth.savePassword", tempstring, server->savePassword, kDefaultSavePassword);    DIR_SetStringPref (prefstring, "auth.dn", tempstring, server->authDn, "");	if (server->savePassword && server->authDn && server->password)	{		DIR_SetStringPref (prefstring, "auth.password", tempstring, server->password, "");	}	else	{		DIR_SetStringPref (prefstring, "auth.password", tempstring, "", "");		PR_FREEIF (server->password);	}	DIR_SetBoolPref (prefstring, "vlvDisabled", tempstring, DIR_TestFlag(server, DIR_LDAP_VLV_DISABLED), kDefaultVLVDisabled);	DIR_SaveCustomAttributes (prefstring, tempstring, server);	DIR_SaveCustomFilters (prefstring, tempstring, server);	dir_SaveReplicationInfo (prefstring, tempstring, server);		DIR_SetIntPref (prefstring, "PalmCategoryId", tempstring, server->PalmCategoryId, -1);	DIR_SetIntPref (prefstring, "PalmSyncTimeStamp", tempstring, server->PalmSyncTimeStamp, 0);	DIR_SetStringPref (prefstring, "customDisplayUrl", tempstring, server->customDisplayUrl, "");	DIR_ClearFlag(server, DIR_SAVING_SERVER);}