Bug 1532388 - followup - fix migration not to create a cientid for non-imap accounts. r+a=mkmelin
authorDaniel Fraser <danielf@linuxmagic.com>
Wed, 29 Jan 2020 16:57:24 +0200
changeset 37883 c648464f1f6296e1b1d92b4cb763cc66ac90a961
parent 37882 7f0c44f9f86a89d7bee0322cdec916ab38a304fc
child 37884 dabb7f5449ced53a98b069ee96fb965aef887e26
push id397
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:16:13 +0000
bugs1532388
Bug 1532388 - followup - fix migration not to create a cientid for non-imap accounts. r+a=mkmelin
mailnews/base/util/mailnewsMigrator.js
--- a/mailnews/base/util/mailnewsMigrator.js
+++ b/mailnews/base/util/mailnewsMigrator.js
@@ -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 {