Bug 1140884 - "An error occurred while sending mail" error message (and other error messages?) garbled. r=mkmelin, a=rkent
authorSuyash Agarwal <syshagarwal@gmail.com>
Sun, 29 Mar 2015 11:46:00 +0200
changeset 25843 af0a31082a9d8d1635a6576e2fe1277731cce059
parent 25842 e29397e78a33b465feeb24dded9e189b1f0bac5b
child 25844 44a5a8e051cb427cd228b85a79951a405efd7661
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, rkent
bugs1140884
Bug 1140884 - "An error occurred while sending mail" error message (and other error messages?) garbled. r=mkmelin, a=rkent
mailnews/compose/src/nsSmtpProtocol.cpp
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -1543,19 +1543,26 @@ nsresult nsSmtpProtocol::SendRecipientRe
     nsresult errorcode;
     if (TestFlag(SMTP_EHLO_SIZE_ENABLED))
       errorcode = (m_responseCode == 452) ? NS_ERROR_SMTP_TEMP_SIZE_EXCEEDED :
                   (m_responseCode == 552) ? NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_2 :
                   NS_ERROR_SENDING_RCPT_COMMAND;
     else
       errorcode = NS_ERROR_SENDING_RCPT_COMMAND;
 
-    rv = nsExplainErrorDetails(m_runningURL, errorcode,
-                               m_responseText.get(),
-                               m_addresses[m_addressesLeft - 1].get());
+    if (errorcode == NS_ERROR_SENDING_RCPT_COMMAND) {
+      rv = nsExplainErrorDetails(
+        m_runningURL, errorcode, NS_ConvertUTF8toUTF16(m_responseText).get(),
+        NS_ConvertUTF8toUTF16(m_addresses[m_addressesLeft - 1]).get());
+    } else {
+      rv = nsExplainErrorDetails(m_runningURL, errorcode,
+                                 m_responseText.get(),
+                                 m_addresses[m_addressesLeft - 1].get());
+    }
+
     NS_ASSERTION(NS_SUCCEEDED(rv), "failed to explain SMTP error");
 
     m_urlErrorState = NS_ERROR_BUT_DONT_SHOW_ALERT;
     return(NS_ERROR_SENDING_RCPT_COMMAND);
   }
 
   if (--m_addressesLeft > 0)
   {