Bug 454449. Backout bustage introduced in rev 6b9c0a5e0777
authorPhilippe M. Chiasson <gozer@mozillamessaging.com>
Mon, 20 Oct 2008 22:26:12 -0400
changeset 656 f74e5af1cf6047bd3b5e5986f120b97dea16134c
parent 654 3795036c606778c6e9c3ad0a892d23202907e56c (diff)
parent 655 06adaf85e2082dc99010159b477a3b093aed9943 (current diff)
child 657 d6fb01b2f85b51d9a95df5917f7f2a1bb80a0ced
push id585
push usergozer@mozillamessaging.com
push dateTue, 21 Oct 2008 02:26:48 +0000
treeherdercomm-central@f74e5af1cf60 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs454449
Bug 454449. Backout bustage introduced in rev 6b9c0a5e0777
new file mode 100644
--- /dev/null
+++ b/mail/base/content/aboutDialog.js
@@ -0,0 +1,86 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla Thunderbird about dialog.
+#
+# The Initial Developer of the Original Code is
+# Blake Ross (blaker@netscape.com).
+# Portions created by the Initial Developer are Copyright (C) 2002
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the LGPL or the GPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+var gSelectedPage = 0;
+
+function onLoad() {
+  document.getElementById("userAgent").value = navigator.userAgent;
+
+  var button = document.documentElement.getButton("extra2");
+  button.setAttribute("label",
+                      document.documentElement.getAttribute("creditslabel"));
+  button.setAttribute("accesskey",
+                      document.documentElement.getAttribute("creditsaccesskey"));
+  button.addEventListener("command", switchPage, false);
+  document.documentElement.getButton("accept").focus();
+#ifdef XP_MACOSX
+  // The dialog may not be sized at this point, and we need its width to
+  // calculate its position.
+  window.sizeToContent();
+  window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2),
+                screen.availHeight / 5);
+#endif
+}
+
+function onUnload(aEvent) {
+  if (aEvent.target != document)
+    return;
+  document.getElementById("creditsIframe").setAttribute("src", "");
+}
+
+function switchPage(aEvent) {
+  var button = aEvent.target;
+  if (button.localName != "button")
+    return;
+
+  var iframe = document.getElementById("creditsIframe");
+  if (gSelectedPage == 0) {
+    iframe.setAttribute("src", "chrome://messenger/content/credits.xhtml");
+    button.setAttribute("label",
+                        document.documentElement.getAttribute("aboutlabel"));
+    button.setAttribute("accesskey",
+                        document.documentElement.getAttribute("aboutaccesskey"));
+    gSelectedPage = 1;
+  } else {
+    iframe.setAttribute("src", "");
+    button.setAttribute("label",
+                        document.documentElement.getAttribute("creditslabel"));
+    button.setAttribute("accesskey",
+                        document.documentElement.getAttribute("creditsaccesskey"));
+    gSelectedPage = 0;
+  }
+  document.getElementById("modes").setAttribute("selectedIndex", gSelectedPage);
+}
--- a/mail/base/content/aboutDialog.xul
+++ b/mail/base/content/aboutDialog.xul
@@ -54,62 +54,18 @@
 #else
         buttons="accept,extra2"
 #endif
         onload="onLoad();" onunload="onUnload(event);"
         title="&aboutDialog.title;"
         creditslabel="&credits.label;" creditsaccesskey="&credits.accesskey;"
         aboutlabel="&aboutLink.label;" aboutaccesskey="&aboutLink.accesskey;">
 
-    <script type="application/x-javascript">
-      <![CDATA[
-        var gSelectedPage = 0;
-
-        function onLoad() {
-          document.getElementById("userAgent").value = navigator.userAgent;
-
-          var button = document.documentElement.getButton("extra2");
-          button.setAttribute("label", document.documentElement.getAttribute("creditslabel"));
-          button.setAttribute("accesskey", document.documentElement.getAttribute("creditsaccesskey"));
-          button.addEventListener("command", switchPage, false);
-          document.documentElement.getButton("accept").focus();
-        }
-
-        function onUnload(aEvent)
-        {
-          if (aEvent.target != document)
-            return;
-          var iframe = document.getElementById("creditsIframe");
-          iframe.setAttribute("src", "");
-        }
-
-        function switchPage(aEvent)
-        {
-          var button = aEvent.target;
-          if (button.localName != "button")
-            return;
-
-          var iframe = document.getElementById("creditsIframe");
-          if (gSelectedPage == 0) { 
-            iframe.setAttribute("src", "chrome://messenger/content/credits.xhtml");
-            button.setAttribute("label", document.documentElement.getAttribute("aboutlabel"));
-            button.setAttribute("accesskey", document.documentElement.getAttribute("aboutaccesskey"));
-            gSelectedPage = 1;
-          }
-          else {
-            iframe.setAttribute("src", ""); 
-            button.setAttribute("label", document.documentElement.getAttribute("creditslabel"));
-            button.setAttribute("accesskey", document.documentElement.getAttribute("creditsaccesskey"));
-            gSelectedPage = 0;
-          }
-          var modes = document.getElementById("modes");
-          modes.setAttribute("selectedIndex", gSelectedPage);
-        }
-      ]]>
-    </script>
+    <script type="application/x-javascript"
+            src="chrome://messenger/content/aboutDialog.js"/>
 
     <deck id="modes" flex="1">
       <vbox flex="1" id="clientBox">
 #expand <label id="versionField" value="&aboutVersion; __MOZ_APP_VERSION__"/>
         <description id="copyright">&copyrightText;</description>
         <textbox id="userAgent" multiline="true" readonly="true" flex="1"/>
       </vbox>
 
--- a/mail/base/jar.mn
+++ b/mail/base/jar.mn
@@ -27,16 +27,17 @@ messenger.jar:
 *   content/messenger/SearchDialog.xul              (content/SearchDialog.xul)
 *   content/messenger/ABSearchDialog.xul            (content/ABSearchDialog.xul)
 *   content/messenger/ABSearchDialog.js             (content/ABSearchDialog.js)
 *   content/messenger/FilterListDialog.xul          (content/FilterListDialog.xul)
 *   content/messenger/FilterListDialog.js           (content/FilterListDialog.js)
 *   content/messenger/subscribe.xul                 (content/subscribe.xul)
     content/messenger/subscribe.js                  (content/subscribe.js)
 *   content/messenger/aboutDialog.xul               (content/aboutDialog.xul)
+*   content/messenger/aboutDialog.js                (content/aboutDialog.js)
 *   content/messenger/defaultClientDialog.xul       (content/defaultClientDialog.xul)
 *   content/messenger/defaultClientDialog.js        (content/defaultClientDialog.js)
 *   content/messenger/msgSelectOffline.xul          (content/msgSelectOffline.xul)
 *   content/messenger/msgPrintEngine.xul            (content/msgPrintEngine.xul)
 *   content/messenger/searchBar.js                  (content/searchBar.js)
 *   content/messenger/phishingDetector.js           (content/phishingDetector.js)
 *   content/messenger/mail-offline.js               (content/mail-offline.js)
     content/messenger/about-footer.png              (content/about-footer.png)
--- a/mail/components/preferences/advanced.xul
+++ b/mail/components/preferences/advanced.xul
@@ -142,16 +142,17 @@
                 <radio id="mark_read_immediately" value="false"
                        label="&markAsReadNoDelay.label;"
                        accesskey="&markAsReadNoDelay.accesskey;"/>
                 <hbox align="center">
                   <radio id="markAsReadAfterDelay" value="true"
                          label="&markAsReadDelay.label;"
                          accesskey="&markAsReadDelay.accesskey;"/>
                   <textbox id="markAsReadDelay" size="2"
+                           type="number" max="2147483"
                            preference="mailnews.mark_message_read.delay.interval"
                            aria-labelledby="markAsReadAfterDelay markAsReadDelay secondsLabel"/>
                   <label id="secondsLabel" value="&secondsLabel.label;"/>
                 </hbox>
               </radiogroup>
             </vbox>
 
             <vbox>
@@ -231,17 +232,20 @@
               <label id="useCacheAfter" flex="1">&useCacheAfter.label;</label>
               <button id="clearCacheButton" icon="clear"
                       label="&clearCacheNow.label;" accesskey="&clearCacheNow.accesskey;"
                       oncommand="gAdvancedPane.clearCache();"/>
             </hbox>
             <hbox align="center">
                 <checkbox id="offlineCompactFolder" label="&offlineCompact.label;" accesskey="&offlineCompact.accesskey;"
                           preference="mail.prompt_purge_threshhold"/>
-                <textbox id="offlineCompactFolderMin" size="5" value="100" preference="mail.purge_threshhold" aria-labelledby="offlineCompactFolder offlineCompactFolderMin compactFolderKB"/>
+                <textbox id="offlineCompactFolderMin" size="5" value="100"
+                         type="number" max="2097151" increment="10"
+                         preference="mail.purge_threshhold"
+                         aria-labelledby="offlineCompactFolder offlineCompactFolderMin compactFolderKB"/>
                 <label id="compactFolderKB" value="&kb.label;"/>
             </hbox>
           </groupbox>
         </tabpanel>
 
         <!-- Update -->
 
         <tabpanel orient="vertical" align="start">
@@ -280,30 +284,28 @@
                     label="&showUpdates.label;" accesskey="&showUpdates.accesskey;"
                     preference="app.update.disable_button.showUpdateHistory"
                     oncommand="gAdvancedPane.showUpdates();"/>
           </hbox>
         </tabpanel>
 
         <!-- Certificates -->
         <tabpanel orient="vertical">
-          <description>&certificatesInfo2.label;</description>
-          <separator class="thin"/>
-          <description class="indent">
+          <hbox>
             <button label="&viewCertificates.label;" accesskey="&viewCertificates.accesskey;"
                     oncommand="gAdvancedPane.showCertificates();"
                     preference="security.disable_button.openCertManager"/>
             <button label="&viewCRLs.label;" accesskey="&viewCRLs.accesskey;"
                     oncommand="gAdvancedPane.showCRLs();"
                     preference="security.OCSP.disable_button.managecrl"/>
             <button label="&validation.label;"
                     accesskey="&validation.accesskey;"
                     oncommand="gAdvancedPane.showOCSP();"/>
             <button label="&viewSecurityDevices.label;" accesskey="&viewSecurityDevices.accesskey;"
                     oncommand="gAdvancedPane.showSecurityDevices();"
                     preference="security.disable_button.openDeviceManager"/>
-          </description>
+          </hbox>
         </tabpanel>
       </tabpanels>
     </tabbox>
     <separator/>
   </prefpane>
 </overlay>
--- a/mail/components/preferences/compose.xul
+++ b/mail/components/preferences/compose.xul
@@ -101,17 +101,19 @@
               </menulist>
               <checkbox id="addExtension" label="&addExtension.label;" preference="mail.forward_add_extension"
                         accesskey="&addExtension.accesskey;"/>
             </hbox>
 
             <hbox align="center" pack="start">
               <checkbox id="autoSave" label="&autoSave.label;" preference="mail.compose.autosave"
                         accesskey="&autoSave.accesskey;"/>
-              <textbox  id="autoSaveInterval" size="2" preference="mail.compose.autosaveinterval" aria-labelledby="autoSave autoSaveInterval autoSaveEnd"/>
+              <textbox id="autoSaveInterval" size="2" type="number" max="35790"
+                       preference="mail.compose.autosaveinterval"
+                       aria-labelledby="autoSave autoSaveInterval autoSaveEnd"/>
               <label id="autoSaveEnd" value="&autoSaveEnd.label;"/>
             </hbox>
 
             <checkbox id="mailWarnOnSendAccelKey" label="&warnOnSendAccelKey.label;"
                       preference="mail.warn_on_send_accel_key"
                       accesskey="&warnOnSendAccelKey.accesskey;"/>
           </groupbox>
 
--- a/mail/installer/windows/nsis/installer.nsi
+++ b/mail/installer/windows/nsis/installer.nsi
@@ -50,17 +50,16 @@ SetCompress off
 CRCCheck on
 
 RequestExecutionLevel user
 
 !addplugindir ./
 
 ; empty files - except for the comment line - for generating custom pages.
 !system 'echo ; > options.ini'
-!system 'echo ; > components.ini'
 !system 'echo ; > shortcuts.ini'
 !system 'echo ; > summary.ini'
 
 ; USE_UAC_PLUGIN is temporary until other apps have been updated to use the UAC plugin
 !define USE_UAC_PLUGIN
 
 Var TmpVal
 Var StartMenuDir
@@ -132,17 +131,16 @@ VIAddVersionKey "OriginalFilename" "setu
 
 Name "${BrandFullName}"
 OutFile "setup.exe"
 InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${AppVersion})" "InstallLocation"
 InstallDir "$PROGRAMFILES\${BrandFullName}\"
 ShowInstDetails nevershow
 
 ReserveFile options.ini
-ReserveFile components.ini
 ReserveFile shortcuts.ini
 ReserveFile summary.ini
 
 ################################################################################
 # Modern User Interface - MUI
 
 !define MUI_ABORTWARNING
 !define MUI_ICON setup.ico
@@ -169,19 +167,16 @@ ReserveFile summary.ini
 ; License Page
 !define MUI_PAGE_CUSTOMFUNCTION_SHOW showLicense
 !define MUI_LICENSEPAGE_CHECKBOX
 !insertmacro MUI_PAGE_LICENSE license.rtf
 
 ; Custom Options Page
 Page custom preOptions leaveOptions
 
-; Custom Components Page
-Page custom preComponents leaveComponents
-
 ; Select Install Directory Page
 !define MUI_PAGE_CUSTOMFUNCTION_PRE preDirectory
 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE leaveDirectory
 !define MUI_DIRECTORYPAGE_VERIFYONLEAVE
 !insertmacro MUI_PAGE_DIRECTORY
 
 ; Custom Shortcuts Page
 Page custom preShortcuts leaveShortcuts
@@ -231,27 +226,16 @@ Section "-InstallStartCleanup"
     ; If the user closed the application it can take several seconds for it to
     ; shut down completely. If the application is being used by another user we
     ; can rename the file and then delete is when the system is restarted.
     Sleep 5000
     ${DeleteFile} "$INSTDIR\${FileMainEXE}"
     ClearErrors
   ${EndIf}
 
-  ${If} $InstallType == ${INSTALLTYPE_CUSTOM}
-    ; Custom installs.
-    ; If DOMi is installed and this install includes DOMi remove it from
-    ; the installation directory. This will remove it if the user deselected
-    ; DOMi on the components page.
-    ${If} ${FileExists} "$INSTDIR\extensions\inspector@mozilla.org"
-    ${AndIf} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
-      RmDir /r "$INSTDIR\extensions\inspector@mozilla.org"
-    ${EndIf}
-  ${EndIf}
-
   ; Remove the updates directory for Vista and above
   ${CleanUpdatesDir} "Thunderbird"
 
   ${InstallStartCleanupCommon}
 SectionEnd
 
 Section "-Application" APP_IDX
   ${StartUninstallLog}
@@ -442,32 +426,16 @@ Section "-Application" APP_IDX
     CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\${FileMainEXE}" 0
     ${LogUninstall} "File: $DESKTOP\${BrandFullName}.lnk"
     ${LogMsg} "Added Shortcut: $DESKTOP\${BrandFullName}.lnk"
   ${EndIf}
 
   !insertmacro MUI_STARTMENU_WRITE_END
 SectionEnd
 
-Section /o "Developer Tools" DOMI_IDX
-  ${If} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
-    SetDetailsPrint both
-    DetailPrint $(STATUS_INSTALL_OPTIONAL)
-    SetDetailsPrint none
-
-    ${RemoveDir} "$INSTDIR\extensions\inspector@mozilla.org"
-    ClearErrors
-    ${LogHeader} "Installing Developer Tools"
-    ${CopyFilesFromDir} "$EXEDIR\optional\extensions\inspector@mozilla.org" \
-                        "$INSTDIR\extensions\inspector@mozilla.org" \
-                        "$(ERROR_CREATE_DIRECTORY_PREFIX)" \
-                        "$(ERROR_CREATE_DIRECTORY_SUFFIX)"
-  ${EndIf}
-SectionEnd
-
 ; Cleanup operations to perform at the end of the installation.
 Section "-InstallEndCleanup"
   SetDetailsPrint both
   DetailPrint "$(STATUS_CLEANUP)"
   SetDetailsPrint none
 
   ${LogHeader} "Updating Uninstall Log With Previous Uninstall Log"
 
@@ -638,33 +606,16 @@ Function leaveOptions
     StrCmp "$R9" "false" +2 +1
     StrCpy $INSTDIR "$R9"
 !endif
 
     Call CheckExistingInstall
   ${EndIf}
 FunctionEnd
 
-Function preComponents
-  ${CheckCustomCommon}
-  ; If DOMi isn't available skip the components page
-  ${Unless} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
-    Abort
-  ${EndUnless}
-  !insertmacro MUI_HEADER_TEXT "$(OPTIONAL_COMPONENTS_TITLE)" "$(OPTIONAL_COMPONENTS_SUBTITLE)"
-  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "components.ini"
-FunctionEnd
-
-Function leaveComponents
-  ${MUI_INSTALLOPTIONS_READ} $R0 "components.ini" "Field 2" "State"
-  ; State will be 1 for checked and 0 for unchecked so we can use that to set
-  ; the section flags for installation.
-  SectionSetFlags ${DOMI_IDX} $R0
-FunctionEnd
-
 Function preDirectory
   ${PreDirectoryCommon}
 FunctionEnd
 
 Function leaveDirectory
   ${LeaveDirectoryCommon} "$(WARN_DISK_SPACE)" "$(WARN_WRITE_ACCESS)"
 FunctionEnd
 
@@ -741,21 +692,16 @@ Function preSummary
   GetDlgItem $0 $HWNDPARENT 1
   System::Call "user32::SetFocus(i r0, i 0x0007, i,i)i"
   ${MUI_INSTALLOPTIONS_READ} $1 "summary.ini" "Field 2" "HWND"
   SendMessage $1 ${WM_SETTEXT} 0 "STR:$INSTDIR"
   !insertmacro MUI_INSTALLOPTIONS_SHOW
 FunctionEnd
 
 Function leaveSummary
-  ${If} $InstallType != ${INSTALLTYPE_CUSTOM}
-    ; Set DOMi to be installed
-    SectionSetFlags ${DOMI_IDX} 1
-  ${EndIf}
-
   ; Try to delete the app executable and if we can't delete it try to find the
   ; app's message window and prompt the user to close the app. This allows
   ; running an instance that is located in another directory. If for whatever
   ; reason there is no message window we will just rename the app's files and
   ; then remove them on restart.
   ClearErrors
   ${DeleteFile} "$INSTDIR\${FileMainEXE}"
   ${If} ${Errors}
@@ -775,17 +721,16 @@ FunctionEnd
 
 Function .onInit
   StrCpy $LANGUAGE 0
   ${SetBrandNameVars} "$EXEDIR\localized\distribution\setup.ini"
 
   ${InstallOnInitCommon} "$(WARN_UNSUPPORTED_MSG)"
 
   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "options.ini"
-  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "components.ini"
   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "shortcuts.ini"
   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "summary.ini"
 
   ; Setup the options.ini file for the Custom Options Page
   WriteINIStr "$PLUGINSDIR\options.ini" "Settings" NumFields "5"
 
   WriteINIStr "$PLUGINSDIR\options.ini" "Field 1" Type   "label"
   WriteINIStr "$PLUGINSDIR\options.ini" "Field 1" Text   "$(OPTIONS_SUMMARY)"
@@ -820,46 +765,16 @@ Function .onInit
 
   WriteINIStr "$PLUGINSDIR\options.ini" "Field 5" Type   "label"
   WriteINIStr "$PLUGINSDIR\options.ini" "Field 5" Text   "$(OPTION_CUSTOM_DESC)"
   WriteINIStr "$PLUGINSDIR\options.ini" "Field 5" Left   "30"
   WriteINIStr "$PLUGINSDIR\options.ini" "Field 5" Right  "-1"
   WriteINIStr "$PLUGINSDIR\options.ini" "Field 5" Top    "67"
   WriteINIStr "$PLUGINSDIR\options.ini" "Field 5" Bottom "87"
 
-  ; Setup the components.ini file for the Custom Components Page  
-  WriteINIStr "$PLUGINSDIR\components.ini" "Settings" NumFields "3"
-
-  WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Type   "label"
-  WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Text   "$(OPTIONAL_COMPONENTS_LABEL)"
-  WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Left   "0"
-  WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Right  "-1"
-  WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Top    "5"
-  WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Bottom "15"
-
-  ${If} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Type   "checkbox"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Text   "$(DOMI_TITLE)"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Left   "15"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Right  "-1"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Top    "20"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Bottom "30"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" State  "1"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Flags  "GROUP"
-  ${EndIf}
-
-  ${If} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 3" Type   "label"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 3" Text   "$(DOMI_TEXT)"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 3" Left   "30"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 3" Right  "-1"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 3" Top    "32"
-    WriteINIStr "$PLUGINSDIR\components.ini" "Field 3" Bottom "52"
-  ${EndIf}
-
   ; Setup the shortcuts.ini for the Custom Shortcuts Page
   WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Settings" NumFields "4"
 
   WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 1" Type   "label"
   WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 1" Text   "$(CREATE_ICONS_DESC)"
   WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 1" Left   "0"
   WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 1" Right  "-1"
   WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 1" Top    "5"
@@ -894,25 +809,16 @@ Function .onInit
   ${GetSize} "$EXEDIR\nonlocalized\" "/S=0K" $R5 $R7 $R8
   ${GetSize} "$EXEDIR\localized\" "/S=0K" $R6 $R7 $R8
   IntOp $R8 $R5 + $R6
   ; Add 1024 Kb to the diskspace requirement since the installer makes a copy
   ; of the MAPI dll's (around 20 Kb)... also, see Bug 434338.
   IntOp $R8 $R8 + 1024
   SectionSetSize ${APP_IDX} $R8
 
-  ${If} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
-    ; Set the section size for DOMi.
-    ${GetSize} "$EXEDIR\optional\extensions\inspector@mozilla.org" "/S=0K" $0 $8 $9
-    SectionSetSize ${DOMI_IDX} $0
-  ${Else}
-    ; Hide DOMi in the components page if it isn't available.
-    SectionSetText ${DOMI_IDX} ""
-  ${EndIf}
-
   ; Initialize $hHeaderBitmap to prevent redundant changing of the bitmap if
   ; the user clicks the back button
   StrCpy $hHeaderBitmap ""
 FunctionEnd
 
 Function .onGUIEnd
   ${OnEndCommon}
 FunctionEnd
--- a/mail/locales/en-US/chrome/messenger/preferences/advanced.dtd
+++ b/mail/locales/en-US/chrome/messenger/preferences/advanced.dtd
@@ -79,17 +79,16 @@
 -->
 <!ENTITY useCacheBefore.label            "Use up to">
 <!ENTITY useCacheBefore.accesskey        "U">
 <!ENTITY useCacheAfter.label             "MB of space for the cache">
 <!ENTITY clearCacheNow.label             "Clear Now">
 <!ENTITY clearCacheNow.accesskey         "C">
 
 <!-- Certificates -->
-<!ENTITY certificatesInfo2.label        "Manage certificates, revocation lists, certificate validation and security devices.">
 <!ENTITY viewCertificates.label         "View Certificates">
 <!ENTITY viewCertificates.accesskey     "a">
 <!ENTITY viewCRLs.label                 "Revocation Lists">
 <!ENTITY viewCRLs.accesskey             "e">
 <!ENTITY validation.label               "Validation">
 <!ENTITY validation.accesskey           "d">
 <!ENTITY viewSecurityDevices.label      "Security Devices">
 <!ENTITY viewSecurityDevices.accesskey  "u">
--- a/mail/locales/en-US/chrome/messenger/preferences/sendoptions.dtd
+++ b/mail/locales/en-US/chrome/messenger/preferences/sendoptions.dtd
@@ -1,41 +1,31 @@
 <!ENTITY dialog.title                 "Send Options">
 <!ENTITY sendMail.title               "Text Format">
 <!ENTITY sendMaildesc.label           "When sending messages in HTML format and one or more recipients are not listed as being able to receive HTML:">
 <!ENTITY askMe.label                  "Ask me what to do">
 <!ENTITY askMe.accesskey              "k">
 <!ENTITY convertPlain.label           "Convert the message to plain text">
-<!ENTITY convertPlain.accesskey       "c">
+<!ENTITY convertPlain.accesskey       "C">
 <!ENTITY sendHTML.label               "Send the message in HTML anyway">
-<!ENTITY sendHTML.accesskey           "s">
+<!ENTITY sendHTML.accesskey           "S">
 <!ENTITY sendBoth.label               "Send the message in both plain text and HTML">
 <!ENTITY sendBoth.accesskey           "e">
-<!ENTITY receiveHTML.label            "If you know a particular recipient can receive HTML mail, uncheck the 'Send email as plain text (no HTML)' checkbox on the recipient's Address Book card.">
 <!ENTITY override.label               "Note: Use the Address Book to specify preferred text formats for recipients.">
 
 <!ENTITY domaindesc.label             "When you send a message to an address with one of the domain names listed below, &brandShortName; automatically sends the message in the correct format.">
 <!ENTITY HTMLTab.label                "HTML Domains">
-<!ENTITY HTMLTab.accesskey            "h">
+<!ENTITY HTMLTab.accesskey            "H">
 <!ENTITY PlainTextTab.label           "Plain Text Domains">
-<!ENTITY PlainTextTab.accesskey       "p">
+<!ENTITY PlainTextTab.accesskey       "P">
 <!ENTITY AddHtmlDomain.label          "Add…">
-<!ENTITY AddHtmlDomain.accesskey      "a">
+<!ENTITY AddHtmlDomain.accesskey      "A">
 <!ENTITY AddPlainText.label           "Add…">
-<!ENTITY AddPlainText.accesskey       "d">
+<!ENTITY AddPlainText.accesskey       "A">
 <!ENTITY DeleteHtmlDomain.label       "Delete">
-<!ENTITY DeleteHtmlDomain.accesskey   "l">
+<!ENTITY DeleteHtmlDomain.accesskey   "D">
 <!ENTITY DeletePlainText.label        "Delete">
-<!ENTITY DeletePlainText.accesskey    "t">
+<!ENTITY DeletePlainText.accesskey    "D">
 
 <!ENTITY add.htmltitle                "Add HTML Domain Name">
 <!ENTITY add.htmldomain               "HTML Domain Name:">
-<!ENTITY add.htmldomain.accesskey     "d">
 <!ENTITY add.plaintexttitle           "Add Plain Text Domain Name">
 <!ENTITY add.plaintextdomain          "Plain Text Domain Name:">
-<!ENTITY add.plaintext.accesskey      "d">
-
-<!-- LOCALIZATION NOTE: do not translate @string@ -->
-<!ENTITY domainnameError.title        "Domain Name Error">
-<!ENTITY duplicationError.label       "The domain name @string@ already exists in this list.">
-
-<!-- LOCALIZATION NOTE: do not translate @string@ -->
-<!ENTITY dualEntryError.label         "A domain name cannot appear in both the HTML and Plain Text lists. The domain name @string@ already exists.">
--- a/mail/locales/en-US/installer/custom.properties
+++ b/mail/locales/en-US/installer/custom.properties
@@ -42,24 +42,17 @@
 # accesskey with an ampersand (e.g. &).
 
 # Don't replace ${BrandShortName}, $(^Name), or $(^NameDA) with a custom string.
 
 # You can use \n to create a newline in the string but only when the string
 # from en-US contains a \n.
 
 REG_APP_DESC=${BrandShortName} is a full-featured email application. ${BrandShortName} supports IMAP and POP mail protocols, as well as HTML mail formatting. Built-in junk mail controls, RSS capabilities, powerful quick search, spell check as you type, global inbox, and advanced message filtering round out ${BrandShortName}'s modern feature set.
-OPTIONAL_COMPONENTS_TITLE=Choose Optional Components
-OPTIONAL_COMPONENTS_SUBTITLE=Choose which features of $(^NameDA) you want to install.
-OPTIONAL_COMPONENTS_LABEL=Optional Components:
 APP_DESC=Required files for the ${BrandShortName} application
-DOMI_TITLE=DOM Inspector
-DOMI_TEXT=Inspects the structure and properties of a window and its contents.
-QFA_TITLE=Quality Feedback Agent
-QFA_TEXT=Sends information about program crashes to Mozilla.
 CONTEXT_OPTIONS=${BrandShortName} &Options
 CONTEXT_SAFE_MODE=${BrandShortName} &Safe Mode
 SAFE_MODE=Safe Mode
 OPTIONS_PAGE_TITLE=Setup Type
 OPTIONS_PAGE_SUBTITLE=Choose setup options
 SHORTCUTS_PAGE_TITLE=Set Up Shortcuts
 SHORTCUTS_PAGE_SUBTITLE=Create Program Icons
 SUMMARY_PAGE_TITLE=Summary
@@ -91,17 +84,16 @@ UN_CONFIRM_PAGE_TITLE=Uninstall $BrandFu
 UN_CONFIRM_PAGE_SUBTITLE=Remove $BrandFullName from your computer.
 UN_CONFIRM_UNINSTALLED_FROM=$BrandShortName will be uninstalled from the following location:
 UN_CONFIRM_CLICK=Click Uninstall to continue.
 
 BANNER_CHECK_EXISTING=Checking existing installation…
 
 STATUS_INSTALL_APP=Installing ${BrandShortName}…
 STATUS_INSTALL_LANG=Installing Language Files (${AB_CD})…
-STATUS_INSTALL_OPTIONAL=Installing Optional Components…
 STATUS_UNINSTALL_MAIN=Uninstalling ${BrandShortName}…
 STATUS_CLEANUP=Cleaning up the birdcage…
 
 # _DESC strings support approximately 65 characters per line.
 # One line
 OPTIONS_SUMMARY=Choose the type of setup you prefer, then click Next.
 # One line
 OPTION_STANDARD_DESC=${BrandShortName} will be installed with the most common options.
--- a/mailnews/base/prefs/resources/content/AccountWizard.js
+++ b/mailnews/base/prefs/resources/content/AccountWizard.js
@@ -969,27 +969,28 @@ function FixupAccountDataForIsp(accountD
       return;
 
     var email = accountData.identity.email;
 
     // The identity might not have an email address, which is what the rest of
     // this function is looking for.
     if (!email)
       return;
-       
+
     // fix up the username
     if (!accountData.incomingServer.username)
         accountData.incomingServer.username = getUsernameFromEmail(email, accountData.incomingServerUserNameRequiresDomain);
 
     if (!accountData.smtp.username &&
         accountData.smtpRequiresUsername) {
       // fix for bug #107953
       // if incoming hostname is same as smtp hostname
       // use the server username (instead of the email username)
-      if (accountData.smtp.hostname == accountData.incomingServer.hostName)
+      if (accountData.smtp.hostname == accountData.incomingServer.hostName &&
+          accountData.smtpUserNameRequiresDomain == accountData.incomingServerUserNameRequiresDomain)
         accountData.smtp.username = accountData.incomingServer.username;
       else
         accountData.smtp.username = getUsernameFromEmail(email, accountData.smtpUserNameRequiresDomain);
     }
 }
 
 function SetCurrentAccountData(accountData)
 {
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -2592,16 +2592,26 @@ NS_IMETHODIMP QuotingOutputStreamListene
           {
             nsCString addressToBeRemoved(_compFields->GetTo());
             if (mIdentity)
             {
               nsCString email;
               mIdentity->GetEmail(email);
               addressToBeRemoved.AppendLiteral(", ");
               addressToBeRemoved.Append(email);
+              // Remove my own address if using Mail-Followup-To (see bug 325429)
+              if (type == nsIMsgCompType::ReplyAll && !mailFollowupTo.IsEmpty())
+              {
+                rv = RemoveDuplicateAddresses(_compFields->GetTo(), email.get(), PR_TRUE, &resultStr);
+                if (NS_SUCCEEDED(rv))
+                {
+                  _compFields->SetTo(resultStr);
+                  PR_Free(resultStr);
+                }
+              }
             }
 
             rv= RemoveDuplicateAddresses(_compFields->GetCc(), addressToBeRemoved.get(), PR_TRUE, &resultStr);
             if (NS_SUCCEEDED(rv))
             {
               _compFields->SetCc(resultStr);
               PR_Free(resultStr);
             }
--- a/mailnews/db/msgdb/src/nsMsgHdr.cpp
+++ b/mailnews/db/msgdb/src/nsMsgHdr.cpp
@@ -874,17 +874,17 @@ void nsMsgHdr::ReparentInThread(nsIMsgTh
   // bail out early for the singleton thread case.
   if (numChildren == 1)
   {
     SetThreadParent(nsMsgKey_None);
     return;
   }
   else
   {
-    nsCOMPtr <nsIMsgDBHdr> curHdr;
+    nsCOMPtr<nsIMsgDBHdr> curHdr;
     // loop through thread, looking for our proper parent.
     for (PRUint32 childIndex = 0; childIndex < numChildren; childIndex++)
     {
       thread->GetChildHdrAt(childIndex, getter_AddRefs(curHdr));
       // closed system, cast ok
       nsMsgHdr* curMsgHdr = static_cast<nsMsgHdr*>(curHdr.get());
       if (curHdr && curMsgHdr->IsParentOf(this))
       {
@@ -892,17 +892,17 @@ void nsMsgHdr::ReparentInThread(nsIMsgTh
         curHdr->GetMessageKey(&curHdrKey);
         SetThreadParent(curHdrKey);
         return;
       }
     }
     // we didn't find it. So either the root header is our parent,
     // or we're the root.
     PRInt32 rootIndex;
-    nsCOMPtr <nsIMsgDBHdr> rootHdr;
+    nsCOMPtr<nsIMsgDBHdr> rootHdr;
     thread->GetRootHdr(&rootIndex, getter_AddRefs(rootHdr));
     NS_ASSERTION(rootHdr, "thread has no root hdr - shouldn't happen");
     if (rootHdr)
     {
       nsMsgKey rootKey;
       rootHdr->GetMessageKey(&rootKey);
       // if we're the root, our thread parent is -1.
       SetThreadParent(rootKey == m_messageKey ? nsMsgKey_None : rootKey);
@@ -920,26 +920,28 @@ PRBool nsMsgHdr::IsAncestorKilled(PRUint
   {
     nsMsgKey threadParent;
     GetThreadParent(&threadParent);
 
     if (threadParent == m_messageKey)
     {
       // isKilled is false by virtue of the enclosing if statement
       NS_ERROR("Thread is parent of itself, please fix!");
-
+      nsCOMPtr<nsIMsgThread> thread;
+      (void) m_mdb->GetThreadContainingMsgHdr(this, getter_AddRefs(thread));
+      ReparentInThread(thread);
       // Something's wrong, but the problem happened some time ago, so erroring
       // out now is probably not a good idea. Ergo, we'll pretend to be OK, show
       // the user the thread (err on the side of caution), and let the assertion
       // alert debuggers to a problem.
       return PR_FALSE;
     }
     if (threadParent != nsMsgKey_None)
     {
-      nsCOMPtr <nsIMsgDBHdr> parentHdr;
+      nsCOMPtr<nsIMsgDBHdr> parentHdr;
       (void) m_mdb->GetMsgHdrForKey(threadParent, getter_AddRefs(parentHdr));
 
       if (parentHdr)
       {
         // More proofing against crashers. This crasher was derived from the
         // fact that something got borked, leaving is in hand with a circular
         // reference to borked headers inducing these loops. The defining
         // characteristic of these headers is that they don't actually seat
--- a/mailnews/db/msgdb/src/nsMsgThread.cpp
+++ b/mailnews/db/msgdb/src/nsMsgThread.cpp
@@ -915,34 +915,51 @@ nsresult nsMsgThread::ReparentMsgsWithIn
 
       curChild->GetThreadParent(&parentKey);
 
       if (parentKey != nsMsgKey_None)
       {
         GetChild(parentKey, getter_AddRefs(parent));
         if (!parent)
           curChild->SetThreadParent(threadParentKey);
+        else
+        {
+          nsMsgKey childKey;
+          curChild->GetMessageKey(&childKey);
+          // can't be your own parent; set parent to thread parent,
+          // or make ourselves the root if we are the root.
+          if (childKey == parentKey)
+            curChild->SetThreadParent(m_threadRootKey == childKey ? 
+                                      nsMsgKey_None : m_threadRootKey);
+        }
       }
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP nsMsgThread::GetRootHdr(PRInt32 *resultIndex, nsIMsgDBHdr **result)
 {
   NS_ENSURE_ARG_POINTER(result);
 
   *result = nsnull;
 
   if (m_threadRootKey != nsMsgKey_None)
   {
     nsresult rv = GetChildHdrForKey(m_threadRootKey, result, resultIndex);
     if (NS_SUCCEEDED(rv) && *result)
-      return rv;
-#ifdef DEBUG_bienvenu
+    {
+      // check that we're really the root key.
+      nsMsgKey parentKey;
+      (*result)->GetThreadParent(&parentKey);
+      if (parentKey == nsMsgKey_None)
+        return rv;
+      NS_RELEASE(*result);
+    }
+#ifdef DEBUG_David_Bienvenu
     printf("need to reset thread root key\n");
 #endif
     PRUint32 numChildren;
     nsMsgKey threadParentKey = nsMsgKey_None;
     GetNumChildren(&numChildren);
 
     for (PRInt32 childIndex = 0; childIndex < (PRInt32) numChildren; childIndex++)
     {
@@ -950,18 +967,22 @@ NS_IMETHODIMP nsMsgThread::GetRootHdr(PR
       rv  = GetChildHdrAt(childIndex, getter_AddRefs(curChild));
       if (NS_SUCCEEDED(rv) && curChild)
       {
         nsMsgKey parentKey;
 
         curChild->GetThreadParent(&parentKey);
         if (parentKey == nsMsgKey_None)
         {
-          NS_ASSERTION(!(*result), "two top level msgs, not good");
           curChild->GetMessageKey(&threadParentKey);
+          if (*result)
+          {
+            NS_WARNING("two top level msgs, not good");
+            continue;
+          }
           SetThreadRootKey(threadParentKey);
           if (resultIndex)
             *resultIndex = childIndex;
           NS_ADDREF(*result = curChild);
           ReparentMsgsWithInvalidParent(numChildren, threadParentKey);
           //            return NS_OK;
         }
       }
@@ -1049,18 +1070,26 @@ nsresult nsMsgThread::GetChildHdrForKey(
       {
         nsMsgKey threadKey;
         (*result)->GetThreadId(&threadKey);
         if (threadKey != m_threadKey) // this msg isn't in this thread
         {
           PRUint32 msgSize;
           (*result)->GetMessageSize(&msgSize);
           if (msgSize == 0) // this is a phantom message - let's get rid of it.
+          {
             RemoveChild(msgKey);
-          rv = NS_ERROR_UNEXPECTED;
+            rv = NS_ERROR_UNEXPECTED;
+          }
+          else
+          {
+            // otherwise, this message really appears to be in this
+            // thread, so fix up its thread id.
+            (*result)->SetThreadId(threadKey);
+          }
         }
         break;
       }
       NS_RELEASE(*result);
     }
   }
   if (resultIndex)
     *resultIndex = childIndex;
--- a/mailnews/import/outlook/src/MapiApi.cpp
+++ b/mailnews/import/outlook/src/MapiApi.cpp
@@ -341,17 +341,18 @@ BOOL CGetStoreFoldersIter::HandleHierarc
 
       if ((name.IsEmpty() && m_isMail) || (!ExcludeFolderClass(name.get()))) {
         pVal = m_pApi->GetMapiProperty( pFolder, PR_DISPLAY_NAME);
         m_pApi->GetStringFromProp( pVal, name);
         CMapiFolder  *pNewFolder = new CMapiFolder(name.get(), cb, pEntry, m_depth);
         m_pList->AddItem( pNewFolder);
 
         pVal = m_pApi->GetMapiProperty( pFolder, PR_FOLDER_TYPE);
-        MAPI_TRACE2( "Type: %d, name: %s\n", m_pApi->GetLongFromProp( pVal), (const char *)name);
+        MAPI_TRACE2("Type: %d, name: %s\n",
+                    m_pApi->GetLongFromProp(pVal), name.get());
         // m_pApi->ListProperties( pFolder);
 
         CGetStoreFoldersIter  nextIter( m_pApi, *m_pList, m_depth + 1, m_isMail);
         m_pApi->IterateHierarchy( &nextIter, pFolder);
       }
       pFolder->Release();
     }
     else {
@@ -639,17 +640,17 @@ void CMapiApi::ListProperties( LPMAPIPRO
 
       LPSPropValue pVal = GetMapiProperty( lpProp, pArray->aulPropTag[i]);
       if (pVal) {
         desc += ", ";
         ListPropertyValue( pVal, desc);
         MAPIFreeBuffer( pVal);
       }
     }
-    MAPI_TRACE2( "    Tag #%d: %s\n", (int)i, (const char *)desc);
+    MAPI_TRACE2("    Tag #%d: %s\n", (int) i, desc.get());
   }
 
   MAPIFreeBuffer( pArray);
 }
 
 ULONG CMapiApi::GetEmailPropertyTag(LPMAPIPROP lpProp, LONG nameID)
 {
 static GUID emailGUID = {
@@ -1320,17 +1321,17 @@ void CMapiApi::ReportLongProp( const cha
   if (pVal)
     MAPIFreeBuffer( pVal);
 }
 
 void CMapiApi::ReportStringProp( const char *pTag, LPSPropValue pVal)
 {
   if ( pVal && (PROP_TYPE( pVal->ulPropTag) == PT_TSTRING)) {
     nsCString val((LPCTSTR) (pVal->Value.LPSZ));
-    MAPI_TRACE2( "%s %s\n", pTag, (const char *)val);
+    MAPI_TRACE2("%s %s\n", pTag, val.get());
   }
   else if (pVal && (PROP_TYPE( pVal->ulPropTag) == PT_NULL)) {
     MAPI_TRACE1( "%s {NULL}\n", pTag);
   }
   else if (pVal && (PROP_TYPE( pVal->ulPropTag) == PT_ERROR)) {
     MAPI_TRACE1( "%s {Error retrieving property}\n", pTag);
   }
   else {
--- a/mailnews/import/outlook/src/MapiMessage.cpp
+++ b/mailnews/import/outlook/src/MapiMessage.cpp
@@ -232,20 +232,20 @@ BOOL CMapiMessage::FetchHeaders( void)
     CMapiApi::MAPIFreeBuffer( pVal);
 
   m_fromLine.Truncate();
   if (NeedsFromLine()) {
     BuildFromLine();
   }
 
   if (!m_fromLine.IsEmpty()) {
-    MAPI_DUMP_STRING( m_fromLine);
+    MAPI_DUMP_STRING(m_fromLine.get());
   }
-  MAPI_DUMP_STRING( m_headers);
-  MAPI_TRACE0( "\r\n");
+  MAPI_DUMP_STRING(m_headers.get());
+  MAPI_TRACE0("\r\n");
 
   ProcessHeaders();
 
   if (!m_headers.IsEmpty()) {
     if (!m_bHasSubject)
       AddSubject( m_headers);
     if (!m_bHasFrom)
       AddFrom( m_headers);
@@ -438,19 +438,19 @@ void CMapiMessage::ProcessHeaders( void)
   // See if we still have data to be processed.
   if (start < hdrLen)
   {
     line.Assign(m_headers.get()+start);
     ProcessHeaderLine(line);
   }
 
   if (!m_mimeContentType.IsEmpty() || !m_mimeBoundary.IsEmpty() || !m_mimeCharset.IsEmpty()) {
-    MAPI_TRACE1( "\tDecoded mime content type: %s\r\n", (PC_S8)m_mimeContentType);
-    MAPI_TRACE1( "\tDecoded mime boundary: %s\r\n", (PC_S8)m_mimeBoundary);
-    MAPI_TRACE1( "\tDecoded mime charset: %s\r\n", (PC_S8)m_mimeCharset);
+    MAPI_TRACE1("\tDecoded mime content type: %s\r\n", m_mimeContentType.get());
+    MAPI_TRACE1("\tDecoded mime boundary: %s\r\n", m_mimeBoundary.get());
+    MAPI_TRACE1("\tDecoded mime charset: %s\r\n", m_mimeCharset.get());
   }
 }
 
 BOOL CMapiMessage::FetchBody( void)
 {
   m_bodyIsHtml = FALSE;
   m_body.Truncate();
   // Is it html?
@@ -479,18 +479,18 @@ BOOL CMapiMessage::FetchBody( void)
         }
       }
     }
   }
 
   if (pVal)
     CMapiApi::MAPIFreeBuffer( pVal);
 
-  MAPI_DUMP_STRING( m_body);
-  MAPI_TRACE0( "\r\n");
+  MAPI_DUMP_STRING(m_body.get());
+  MAPI_TRACE0("\r\n");
 
   return( TRUE);
 }
 
 enum {
   ieidPR_ATTACH_NUM = 0,
   ieidAttachMax
 };
@@ -610,20 +610,22 @@ BOOL CMapiMessage::CopyBinAttachToFile( 
   rv = tmpFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 00600);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCString tmpPath;
   tmpFile->GetNativePath(tmpPath);
   HRESULT hr = CMapiApi::OpenStreamOnFile( gpMapiAllocateBuffer, gpMapiFreeBuffer, STGM_READWRITE | STGM_CREATE,
     (char *) tmpPath.get(), NULL, &lpStreamFile);
   if (HR_FAILED(hr)) {
-    MAPI_TRACE1( "~~ERROR~~ OpenStreamOnFile failed - temp path: %s\r\n", tPath);
+    MAPI_TRACE1("~~ERROR~~ OpenStreamOnFile failed - temp path: %s\r\n",
+                tmpPath.get());
     return( FALSE);
   }
-  MAPI_TRACE1( "\t\t** Attachment extracted to temp file: %s\r\n", (const char *)m_attachPath);
+  MAPI_TRACE1("\t\t** Attachment extracted to temp file: %s\r\n",
+              m_attachPath.get());
 
   BOOL bResult = TRUE;
   LPSTREAM lpAttachStream;
   hr = lpAttach->OpenProperty( PR_ATTACH_DATA_BIN, &IID_IStream, 0, 0, (LPUNKNOWN *)&lpAttachStream);
 
   if (HR_FAILED( hr)) {
     MAPI_TRACE0( "~~ERROR~~ OpenProperty failed for PR_ATTACH_DATA_BIN.\r\n");
     lpAttachStream = NULL;
@@ -684,17 +686,18 @@ BOOL CMapiMessage::GetAttachmentInfo( in
   pVal = CMapiApi::GetMapiProperty( lpAttach, PR_ATTACH_METHOD);
   if (pVal) {
     LONG aMethod = CMapiApi::GetLongFromProp( pVal);
     if ((aMethod == ATTACH_BY_REF_ONLY) || (aMethod == ATTACH_BY_REFERENCE) || (aMethod == ATTACH_BY_REF_RESOLVE)) {
       m_attachPath.Truncate();
       pVal = CMapiApi::GetMapiProperty( lpAttach, PR_ATTACH_PATHNAME);
       if (pVal)
         CMapiApi::GetStringFromProp( pVal, m_attachPath);
-      MAPI_TRACE2( "\t\t** Attachment #%d by ref: %s\r\n", idx, (const char *)m_attachPath);
+      MAPI_TRACE2("\t\t** Attachment #%d by ref: %s\r\n",
+                  idx, m_attachPath.get());
       m_ownsAttachFile = FALSE;
     }
     else if (aMethod == ATTACH_BY_VALUE) {
       MAPI_TRACE1( "\t\t** Attachment #%d by value.\r\n", idx);
       bResult = CopyBinAttachToFile( lpAttach);
     }
     else if (aMethod == ATTACH_OLE) {
       MAPI_TRACE1( "\t\t** Attachment #%d by OLE - yuck!!!\r\n", idx);
@@ -729,19 +732,20 @@ BOOL CMapiMessage::GetAttachmentInfo( in
     // sure it has some important meaning which will one day be obvious, but for now,
     // it is ignored.
         pVal = CMapiApi::GetMapiProperty( lpAttach, PR_ATTACH_TAG);
        if (pVal) {
         ::MAPIFreeBuffer( pVal);
       }
   */
 
-  MAPI_TRACE1( "\t\t\t--- Mime type: %s\r\n", (const char *)m_attachMimeType);
-  MAPI_TRACE2( "\t\t\t--- File name: %s, extension: %s\r\n", (const char *)fName, (const char *)fExt);
-  MAPI_TRACE1( "\t\t\t--- Size: %ld\r\n", sz);
+  MAPI_TRACE1("\t\t\t--- Mime type: %s\r\n", m_attachMimeType.get());
+  MAPI_TRACE2("\t\t\t--- File name: %s, extension: %s\r\n",
+              fName.get(), fExt.get());
+  MAPI_TRACE1("\t\t\t--- Size: %ld\r\n", sz);
 
   if (fExt.IsEmpty()) {
     int idx = fName.RFindChar( '.');
     if (idx != -1)
       fName.Right( fExt, fName.Length() - idx);
   }
 
   if ((fName.RFindChar( '.') == -1) && !fExt.IsEmpty()) {
@@ -760,15 +764,15 @@ BOOL CMapiMessage::GetAttachmentInfo( in
       m_attachMimeType = (PC_S8)pType;
     else
       m_attachMimeType = "application/octet-stream";
   }
 
   pVal = CMapiApi::GetMapiProperty( lpAttach, PR_ATTACH_TRANSPORT_NAME);
   if (pVal) {
     CMapiApi::GetStringFromProp( pVal, fName);
-    MAPI_TRACE1( "\t\t\t--- Transport name: %s\r\n", (const char *)fName);
+    MAPI_TRACE1("\t\t\t--- Transport name: %s\r\n", fName.get());
   }
 
   lpAttach->Release();
 
   return( bResult);
 }