nsCOMPtr<nsIMsgIncomingServer> server(do_QueryInterface(servers->ElementAt(0)));
nsCOMPtr<nsISupports> aSupport = getter_AddRefs(servers->ElementAt(0)); nsCOMPtr<nsIMsgIncomingServer> server(do_QueryInterface(aSupport));
nsGetImapRoot(const char* hostname, nsFileSpec &result){    nsresult rv = NS_OK; 	NS_WITH_SERVICE(nsIMsgMailSession, session, kMsgMailSessionCID, &rv);     if (NS_FAILED(rv)) return rv;	nsCOMPtr<nsIMsgAccountManager> accountManager;	rv = session->GetAccountManager(getter_AddRefs(accountManager));    if(NS_FAILED(rv)) return rv;    nsCOMPtr<nsISupportsArray> servers;    rv = accountManager->FindServersByHostname(hostname,                                               nsIImapIncomingServer::GetIID(),                                               getter_AddRefs(servers));    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIMsgIncomingServer>        server(do_QueryInterface(servers->ElementAt(0)));    char *localPath = nsnull;    if (server)		rv = server->GetLocalPath(&localPath);    result = localPath;    return rv;}