diff --git a/mailnews/local/src/nsPop3Service.cpp b/mailnews/local/src/nsPop3Service.cpp index 4a69a83c2fc..ded714748a2 100644 --- a/mailnews/local/src/nsPop3Service.cpp +++ b/mailnews/local/src/nsPop3Service.cpp @@ -374,14 +374,14 @@ NS_IMETHODIMP nsPop3Service::NewChannel(nsIURI *aURI, nsIChannel **_retval) nsCOMPtr url = do_QueryInterface(aURI, &rv); if (NS_SUCCEEDED(rv) && url) { - // GetUsername() returns an escaped username, and the protocol - // stores the username unescaped, so we must unescape the username. - // XXX this is of course very risky since the unescaped string may - // contain embedded nulls as well as characters from some unknown - // charset!! - url->GetUsername(username); - NS_UnescapeURL(username); - protocol->SetUsername(username.get()); + nsXPIDLCString realUserName; + nsCOMPtr server; + url->GetServer(getter_AddRefs(server)); + if (server) + { + server->GetRealUsername(getter_Copies(realUserName)); + protocol->SetUsername(realUserName.get()); + } } rv = protocol->QueryInterface(NS_GET_IID(nsIChannel), (void **) _retval); }