Bug 1340724 - fix SMTP server name output in SMTP logging. r=jorgk a=jorgk
authoraceman <acelists@atlas.sk>
Sat, 18 Feb 2017 21:19:44 +0100
changeset 26989 fc0070ab1372eacf3489fddce8923a856d60701d
parent 26988 bdee8706c9841b307606e61d08fabe1dd9623bca
child 26990 5a493ed511c448d732f611197658e3c7d750905d
push idunknown
push userunknown
push dateunknown
reviewersjorgk, jorgk
bugs1340724
Bug 1340724 - fix SMTP server name output in SMTP logging. r=jorgk a=jorgk
mailnews/compose/src/nsSmtpProtocol.cpp
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -1326,18 +1326,22 @@ nsresult nsSmtpProtocol::AuthLoginStep1(
   rv = smtpServer->GetUsername(username);
   if (username.IsEmpty())
   {
     rv = GetUsernamePassword(username, password);
     m_usernamePrompted = true;
     if (username.IsEmpty() || password.IsEmpty())
       return NS_ERROR_SMTP_PASSWORD_UNDEFINED;
   }
+
+  nsCString hostname;
+  smtpServer->GetHostname(hostname);
+
   MOZ_LOG(SMTPLogModule, mozilla::LogLevel::Debug, ("SMTP AuthLoginStep1() for %s@%s",
-      username.get(), smtpServer.get()));
+      username.get(), hostname.get()));
 
   GetPassword(password);
   if (password.IsEmpty())
   {
     MOZ_LOG(SMTPLogModule, mozilla::LogLevel::Error, ("SMTP: password undefined"));
     m_urlErrorState = NS_ERROR_SMTP_PASSWORD_UNDEFINED;
     return NS_ERROR_SMTP_PASSWORD_UNDEFINED;
   }