Bug 1532388 - followup - fix migration not to create a cientid for non-imap accounts. r=mkmelin
authorDaniel Fraser <danielf@linuxmagic.com>
Wed, 29 Jan 2020 16:57:24 +0200
changeset 37155 05e79793c4929689a83ccaf092ef15e026b26a6d
parent 37154 66070529eac2ec0d93e3855674a3a6f87b132106
child 37156 8d8d787c4fa726866891ac661d0b4319c6dc8730
push id2552
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:24:16 +0000
treeherdercomm-beta@f95a6f4408a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1532388
Bug 1532388 - followup - fix migration not to create a cientid for non-imap accounts. r=mkmelin
mailnews/base/util/MailnewsMigrator.jsm
--- a/mailnews/base/util/MailnewsMigrator.jsm
+++ b/mailnews/base/util/MailnewsMigrator.jsm
@@ -114,21 +114,25 @@ function MigrateProfileClientid() {
 
   // Now walk all imap accounts and generate any missing CLIENTIDS, reusing
   // cached CLIENTIDS if possible.
   for (let key of accounts.split(",")) {
     let serverKey = Services.prefs.getCharPref(
       "mail.account." + key + ".server"
     );
     let server = "mail.server." + serverKey + ".";
-    // Check if this server needs the CLIENTID preference to be populated.
+    // Check if this imap server needs the CLIENTID preference to be populated.
     if (
       !Services.prefs.prefHasUserValue(server + "clientid") ||
       !Services.prefs.getCharPref(server + "clientid", "")
     ) {
+      // Clientid should only be provisioned for imap accounts.
+      if (Services.prefs.getCharPref(server + "type", "") != "imap") {
+        continue;
+      }
       // Grab username + hostname to check if a CLIENTID is cached.
       let username = Services.prefs.getCharPref(server + "userName", "");
       if (!username) {
         continue;
       }
       let hostname = Services.prefs.getCharPref(server + "hostname");
       let combinedKey;
       try {