if (NS_SUCCEEDED(rv)) {
if (thisServer && NS_SUCCEEDED(rv)) {
nsMsgAccountManager::findServersForIdentity(nsISupports *element, void *aData){  nsresult rv;  nsCOMPtr<nsIMsgAccount> account = do_QueryInterface(element, &rv);  if (NS_FAILED(rv)) return PR_TRUE;    findServersByIdentityEntry *entry = (findServersByIdentityEntry*)aData;  nsCOMPtr<nsISupportsArray> identities;  account->GetIdentities(getter_AddRefs(identities));  PRUint32 idCount=0;  identities->Count(&idCount);  PRUint32 id;  nsXPIDLCString identityKey;  rv = entry->identity->GetKey(getter_Copies(identityKey));    for (id=0; id<idCount; id++) {    // convert supports->Identity    nsCOMPtr<nsISupports> thisSupports;    rv = identities->GetElementAt(id, getter_AddRefs(thisSupports));    if (NS_FAILED(rv)) continue;        nsCOMPtr<nsIMsgIdentity>      thisIdentity = do_QueryInterface(thisSupports, &rv);    if (NS_SUCCEEDED(rv)) {      nsXPIDLCString thisIdentityKey;      rv = thisIdentity->GetKey(getter_Copies(thisIdentityKey));      if (NS_SUCCEEDED(rv) && PL_strcmp(identityKey, thisIdentityKey) == 0) {        nsCOMPtr<nsIMsgIncomingServer> thisServer;        rv = account->GetIncomingServer(getter_AddRefs(thisServer));                if (NS_SUCCEEDED(rv)) {          entry->servers->AppendElement(thisServer);          break;        }              }    }  }  return PR_TRUE;}