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 38034 05e79793c4929689a83ccaf092ef15e026b26a6d
parent 38033 66070529eac2ec0d93e3855674a3a6f87b132106
child 38035 8d8d787c4fa726866891ac661d0b4319c6dc8730
push id398
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:10:28 +0000
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 {