NS_WITH_SERVICE(nsIMsgMailSession, session, kMsgMailSessionCID, &rv);
NS_WITH_SERVICE(nsIMsgAccountManager, accountManager, NS_MSGACCOUNTMANAGER_PROGID, &rv);
nsGetNewsServer(const char* username, const char *hostname,                nsIMsgIncomingServer** aResult){#ifdef DEBUG_NEWS  printf("nsGetNewsServer(%s,%s,??)\n",username,hostname);#endif  nsresult rv = NS_OK;  // retrieve the AccountManager  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;                      // find the news host  nsCOMPtr<nsIMsgIncomingServer> server;  rv = accountManager->FindServer(username,                                  hostname,                                  "nntp",                                  getter_AddRefs(server));  if (NS_FAILED(rv)) return rv;   *aResult = server;  NS_ADDREF(*aResult);    return rv;}