Bug 1478572 - Turn on ESLint in mail/components/accountcreation (automatic changes). r=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 30 Jul 2018 02:38:00 +0200
changeset 32716 dbabbfef78c1a89f07f7708d22ff6bd7ccb3718c
parent 32715 75492d81b44d54bbd780c367a8f292e0c82c9e30
child 32717 f536b94ef28519efeaa88c9f2cc6b879a69f5bb9
push id386
push userclokep@gmail.com
push dateTue, 23 Oct 2018 00:48:12 +0000
reviewersjorgk
bugs1478572
Bug 1478572 - Turn on ESLint in mail/components/accountcreation (automatic changes). r=jorgk
.eslintignore
mail/components/accountcreation/content/MyBadCertHandler.js
mail/components/accountcreation/content/accountConfig.js
mail/components/accountcreation/content/createInBackend.js
mail/components/accountcreation/content/emailWizard.js
mail/components/accountcreation/content/fetchConfig.js
mail/components/accountcreation/content/fetchhttp.js
mail/components/accountcreation/content/guessConfig.js
mail/components/accountcreation/content/readFromXML.js
mail/components/accountcreation/content/sanitizeDatatypes.js
mail/components/accountcreation/content/util.js
mail/components/accountcreation/content/verifyConfig.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -36,16 +36,17 @@ mail/extensions/**
 mail/installer/**
 mail/locales/**
 mail/test/**
 mail/themes/**
 
 # mail/components exclusions
 mail/components/*
 !mail/components/about-support
+!mail/components/accountcreation
 !mail/components/extensions
 
 # calendar/ exclusions
 
 # prefs files
 calendar/lightning/content/lightning.js
 calendar/locales/en-US/lightning-l10n.js
 
--- a/mail/components/accountcreation/content/MyBadCertHandler.js
+++ b/mail/components/accountcreation/content/MyBadCertHandler.js
@@ -4,33 +4,32 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * This class implements nsIBadCertListener.  It's job is to prevent "bad cert"
  * security dialogs from being shown to the user.  We call back to the
  * 'callback' object's method "processCertError" so that it can deal with it as
  * needed (in the case of autoconfig, setting up temporary overrides).
  */
-function BadCertHandler(callback)
-{
+function BadCertHandler(callback) {
   this._init(callback);
 }
 
 BadCertHandler.prototype =
 {
-  _init: function(callback) {
+  _init(callback) {
     this._callback = callback;
   },
 
   // Suppress any certificate errors
-  notifyCertProblem: function(socketInfo, status, targetSite) {
+  notifyCertProblem(socketInfo, status, targetSite) {
     return this._callback.processCertError(socketInfo, status, targetSite);
   },
 
   // nsIInterfaceRequestor
-  getInterface: function(iid) {
+  getInterface(iid) {
     return this.QueryInterface(iid);
   },
 
   // nsISupports
   QueryInterface: ChromeUtils.generateQI(["nsIBadCertListener2",
                                           "nsIInterfaceRequestor"]),
 };
--- a/mail/components/accountcreation/content/accountConfig.js
+++ b/mail/components/accountcreation/content/accountConfig.js
@@ -15,153 +15,148 @@
  * new object and returns that, and the caller can copy these
  * values into the object used by the UI.
  *
  * See also
  * <https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat>
  * for values stored.
  */
 
-function AccountConfig()
-{
+function AccountConfig() {
   this.incoming = this.createNewIncoming();
   this.incomingAlternatives = [];
   this.outgoing = this.createNewOutgoing();
   this.outgoingAlternatives = [];
   this.identity =
   {
     // displayed real name of user
-    realname : "%REALNAME%",
+    realname: "%REALNAME%",
     // email address of user, as shown in From of outgoing mails
-    emailAddress : "%EMAILADDRESS%",
+    emailAddress: "%EMAILADDRESS%",
   };
   this.inputFields = [];
   this.domains = [];
-};
+}
 AccountConfig.prototype =
 {
   // @see createNewIncoming()
-  incoming : null,
+  incoming: null,
   // @see createNewOutgoing()
-  outgoing : null,
+  outgoing: null,
   /**
    * Other servers which can be used instead of |incoming|,
    * in order of decreasing preference.
    * (|incoming| itself should not be included here.)
    * { Array of incoming/createNewIncoming() }
    */
-  incomingAlternatives : null,
-  outgoingAlternatives : null,
+  incomingAlternatives: null,
+  outgoingAlternatives: null,
   // OAuth2 configuration, if needed.
-  oauthSettings : null,
+  oauthSettings: null,
   // just an internal string to refer to this. Do not show to user.
-  id : null,
+  id: null,
   // who created the config.
   // { one of kSource* }
-  source : 0,
-  displayName : null,
+  source: 0,
+  displayName: null,
   // { Array of { varname (value without %), displayName, exampleValue } }
-  inputFields : null,
+  inputFields: null,
   // email address domains for which this config is applicable
   // { Array of Strings }
-  domains : null,
+  domains: null,
 
   /**
    * Factory function for incoming and incomingAlternatives
    */
-  createNewIncoming : function()
-  {
+  createNewIncoming() {
     return {
       // { String-enum: "pop3", "imap", "nntp" }
-      type : null,
-      hostname : null,
+      type: null,
+      hostname: null,
       // { Integer }
-      port : null,
+      port: null,
       // May be a placeholder (starts and ends with %). { String }
-      username : null,
-      password : null,
+      username: null,
+      password: null,
       // { enum: 1 = plain, 2 = SSL/TLS, 3 = STARTTLS always, 0 = not inited }
       // ('TLS when available' is insecure and not supported here)
-      socketType : 0,
+      socketType: 0,
       /**
        * true when the cert is invalid (and thus SSL useless), because it's
        * 1) not from an accepted CA (including self-signed certs)
        * 2) for a different hostname or
        * 3) expired.
        * May go back to false when user explicitly accepted the cert.
        */
-      badCert : false,
+      badCert: false,
       /**
        * How to log in to the server: plaintext or encrypted pw, GSSAPI etc.
        * Defined by Ci.nsMsgAuthMethod
        * Same as server pref "authMethod".
        */
-      auth : 0,
+      auth: 0,
       /**
        * Other auth methods that we think the server supports.
        * They are ordered by descreasing preference.
        * (|auth| itself is not included in |authAlternatives|)
        * {Array of Ci.nsMsgAuthMethod} (same as .auth)
        */
-      authAlternatives : null,
+      authAlternatives: null,
       // in minutes { Integer }
-      checkInterval : 10,
-      loginAtStartup : true,
+      checkInterval: 10,
+      loginAtStartup: true,
       // POP3 only:
       // Not yet implemented. { Boolean }
-      useGlobalInbox : false,
-      leaveMessagesOnServer : true,
-      daysToLeaveMessagesOnServer : 14,
-      deleteByAgeFromServer : true,
+      useGlobalInbox: false,
+      leaveMessagesOnServer: true,
+      daysToLeaveMessagesOnServer: 14,
+      deleteByAgeFromServer: true,
       // When user hits delete, delete from local store and from server
-      deleteOnServerWhenLocalDelete : true,
-      downloadOnBiff : true,
+      deleteOnServerWhenLocalDelete: true,
+      downloadOnBiff: true,
     };
   },
   /**
    * Factory function for outgoing and outgoingAlternatives
    */
-  createNewOutgoing : function()
-  {
+  createNewOutgoing() {
     return {
-      type : "smtp",
-      hostname : null,
-      port : null, // see incoming
-      username : null, // see incoming. may be null, if auth is 0.
-      password : null, // see incoming. may be null, if auth is 0.
-      socketType : 0, // see incoming
-      badCert : false, // see incoming
-      auth : 0, // see incoming
-      authAlternatives : null, // see incoming
-      addThisServer : true, // if we already have an SMTP server, add this
+      type: "smtp",
+      hostname: null,
+      port: null,     // see incoming
+      username: null, // see incoming. may be null, if auth is 0.
+      password: null, // see incoming. may be null, if auth is 0.
+      socketType: 0,  // see incoming
+      badCert: false, // see incoming
+      auth: 0,        // see incoming
+      authAlternatives: null, // see incoming
+      addThisServer: true,    // if we already have an SMTP server, add this
       // if we already have an SMTP server, use it.
-      useGlobalPreferredServer : false,
+      useGlobalPreferredServer: false,
       // we should reuse an already configured SMTP server.
       // nsISmtpServer.key
-      existingServerKey : null,
+      existingServerKey: null,
       // user display value for existingServerKey
-      existingServerLabel : null,
+      existingServerLabel: null,
     };
   },
 
   /**
    * Returns a deep copy of this object,
    * i.e. modifying the copy will not affect the original object.
    */
-  copy : function()
-  {
+  copy() {
     // Workaround: deepCopy() fails to preserve base obj (instanceof)
     var result = new AccountConfig();
     for (var prop in this)
       result[prop] = deepCopy(this[prop]);
 
     return result;
   },
-  isComplete : function()
-  {
+  isComplete() {
     return (!!this.incoming.hostname && !!this.incoming.port &&
          !!this.incoming.socketType && !!this.incoming.auth &&
          !!this.incoming.username &&
          (!!this.outgoing.existingServerKey ||
           (!!this.outgoing.hostname && !!this.outgoing.port &&
            !!this.outgoing.socketType && !!this.outgoing.auth &&
            !!this.outgoing.username)));
   },
@@ -204,18 +199,17 @@ AccountConfig.kSourceGuess = 3; // guess
  * Empty of incomplete email addresses will/may be rejected.
  *
  * @param realname {String}
  * Real name of user, as will appear in From of outgoing messages
  *
  * @param password {String}
  * The password for the incoming server and (if necessary) the outgoing server
  */
-function replaceVariables(account, realname, emailfull, password)
-{
+function replaceVariables(account, realname, emailfull, password) {
   sanitize.nonemptystring(emailfull);
   let emailsplit = emailfull.split("@");
   assert(emailsplit.length == 2,
          "email address not in expected format: must contain exactly one @");
   let emaillocal = sanitize.nonemptystring(emailsplit[0]);
   let emaildomain = sanitize.hostname(emailsplit[1]);
   sanitize.label(realname);
   sanitize.nonemptystring(realname);
@@ -241,18 +235,17 @@ function replaceVariables(account, realn
         _replaceVariable(account.outgoing.hostname, otherVariables);
   account.identity.realname =
       _replaceVariable(account.identity.realname, otherVariables);
   account.identity.emailAddress =
       _replaceVariable(account.identity.emailAddress, otherVariables);
   account.displayName = _replaceVariable(account.displayName, otherVariables);
 }
 
-function _replaceVariable(variable, values)
-{
+function _replaceVariable(variable, values) {
   let str = variable;
   if (typeof(str) != "string")
     return str;
 
   for (let varname in values)
       str = str.replace("%" + varname + "%", values[varname]);
 
   return str;
--- a/mail/components/accountcreation/content/createInBackend.js
+++ b/mail/components/accountcreation/content/createInBackend.js
@@ -10,18 +10,17 @@
  * @param config {AccountConfig} The account to create
  *
  * @return - the account created.
  */
 
 ChromeUtils.import("resource:///modules/mailServices.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-function createAccountInBackend(config)
-{
+function createAccountInBackend(config) {
   // incoming server
   let inServer = MailServices.accounts.createIncomingServer(
       config.incoming.username,
       config.incoming.hostname,
       sanitize.enum(config.incoming.type, ["pop3", "imap", "nntp"]));
   inServer.port = config.incoming.port;
   inServer.authMethod = config.incoming.auth;
   inServer.password = config.incoming.password;
@@ -35,29 +34,28 @@ function createAccountInBackend(config)
 
   // SSL
   if (config.incoming.socketType == 1) // plain
     inServer.socketType = Ci.nsMsgSocketType.plain;
   else if (config.incoming.socketType == 2) // SSL / TLS
     inServer.socketType = Ci.nsMsgSocketType.SSL;
   else if (config.incoming.socketType == 3) // STARTTLS
     inServer.socketType = Ci.nsMsgSocketType.alwaysSTARTTLS;
-  //inServer.prettyName = config.displayName;
+  // inServer.prettyName = config.displayName;
   inServer.prettyName = config.identity.emailAddress;
 
   inServer.doBiff = true;
   inServer.biffMinutes = config.incoming.checkInterval;
   const loginAtStartupPrefTemplate =
     "mail.server.%serverkey%.login_at_startup";
   var loginAtStartupPref =
     loginAtStartupPrefTemplate.replace("%serverkey%", inServer.key);
   Services.prefs.setBoolPref(loginAtStartupPref,
                              config.incoming.loginAtStartup);
-  if (config.incoming.type == "pop3")
-  {
+  if (config.incoming.type == "pop3") {
     const leaveOnServerPrefTemplate =
       "mail.server.%serverkey%.leave_on_server";
     const daysToLeaveOnServerPrefTemplate =
       "mail.server.%serverkey%.num_days_to_leave_on_server";
     const deleteFromServerPrefTemplate =
       "mail.server.%serverkey%.delete_mail_left_on_server";
     const deleteByAgeFromServerPrefTemplate =
       "mail.server.%serverkey%.delete_by_age_from_server";
@@ -88,24 +86,22 @@ function createAccountInBackend(config)
 
   let username = config.outgoing.auth > 1 ? config.outgoing.username : null;
   let outServer = MailServices.smtp.findServer(username, config.outgoing.hostname);
   assert(config.outgoing.addThisServer ||
          config.outgoing.useGlobalPreferredServer ||
          config.outgoing.existingServerKey,
          "No SMTP server: inconsistent flags");
 
-  if (config.outgoing.addThisServer && !outServer)
-  {
+  if (config.outgoing.addThisServer && !outServer) {
     outServer = MailServices.smtp.createServer();
     outServer.hostname = config.outgoing.hostname;
     outServer.port = config.outgoing.port;
     outServer.authMethod = config.outgoing.auth;
-    if (config.outgoing.auth > 1)
-    {
+    if (config.outgoing.auth > 1) {
       outServer.username = username;
       outServer.password = config.incoming.password;
       if (config.rememberPassword && config.incoming.password.length)
         rememberPassword(outServer, config.incoming.password);
     }
 
     if (outServer.authMethod == Ci.nsMsgAuthMethod.OAuth2) {
       let pref = "mail.smtpserver." + outServer.key + ".";
@@ -136,29 +132,26 @@ function createAccountInBackend(config)
   // identity
   // TODO accounts without identity?
   let identity = MailServices.accounts.createIdentity();
   identity.fullName = config.identity.realname;
   identity.email = config.identity.emailAddress;
 
   // for new accounts, default to replies being positioned above the quote
   // if a default account is defined already, take its settings instead
-  if (config.incoming.type == "imap" || config.incoming.type == "pop3")
-  {
+  if (config.incoming.type == "imap" || config.incoming.type == "pop3") {
     identity.replyOnTop = 1;
     // identity.sigBottom = false; // don't set this until Bug 218346 is fixed
 
     if (MailServices.accounts.accounts.length &&
-        MailServices.accounts.defaultAccount)
-    {
+        MailServices.accounts.defaultAccount) {
       let defAccount = MailServices.accounts.defaultAccount;
       let defIdentity = defAccount.defaultIdentity;
       if (defAccount.incomingServer.canBeDefaultServer &&
-          defIdentity && defIdentity.valid)
-      {
+          defIdentity && defIdentity.valid) {
         identity.replyOnTop = defIdentity.replyOnTop;
         identity.sigBottom = defIdentity.sigBottom;
       }
     }
   }
 
   // due to accepted conventions, news accounts should default to plain text
   if (config.incoming.type == "nntp")
@@ -192,18 +185,17 @@ function createAccountInBackend(config)
   try {
     Services.prefs.savePrefFile(null);
   } catch (ex) {
     ddump("Could not write out prefs: " + ex);
   }
   return account;
 }
 
-function setFolders(identity, server)
-{
+function setFolders(identity, server) {
   // TODO: support for local folders for global inbox (or use smart search
   // folder instead)
 
   var baseURI = server.serverURI + "/";
 
   // Names will be localized in UI, not in folder names on server/disk
   // TODO allow to override these names in the XML config file,
   // in case e.g. Google or AOL use different names?
@@ -216,18 +208,17 @@ function setFolders(identity, server)
   identity.stationeryFolder = baseURI + templatesName;
   identity.fccFolder = baseURI + fccName;
 
   identity.fccFolderPickerMode = 0;
   identity.draftsFolderPickerMode = 0;
   identity.tmplFolderPickerMode = 0;
 }
 
-function rememberPassword(server, password)
-{
+function rememberPassword(server, password) {
   if (server instanceof Ci.nsIMsgIncomingServer)
     var passwordURI = server.localStoreType + "://" + server.hostName;
   else if (server instanceof Ci.nsISmtpServer)
     var passwordURI = "smtp://" + server.hostname;
   else
     throw new NotReached("Server type not supported");
 
   let login = Cc["@mozilla.org/login-manager/loginInfo;1"]
@@ -250,84 +241,76 @@ function rememberPassword(server, passwo
  * in the config.
  * (We also check the email address as username.)
  *
  * @param config {AccountConfig} filled in (no placeholders)
  * @return {nsIMsgIncomingServer} If it already exists, the server
  *     object is returned.
  *     If it's a new server, |null| is returned.
  */
-function checkIncomingServerAlreadyExists(config)
-{
+function checkIncomingServerAlreadyExists(config) {
   assert(config instanceof AccountConfig);
   let incoming = config.incoming;
   let existing = MailServices.accounts.findRealServer(incoming.username,
         incoming.hostname,
         sanitize.enum(incoming.type, ["pop3", "imap", "nntp"]),
         incoming.port);
 
   // if username does not have an '@', also check the e-mail
   // address form of the name.
   if (!existing && !incoming.username.includes("@"))
     existing = MailServices.accounts.findRealServer(config.identity.emailAddress,
           incoming.hostname,
           sanitize.enum(incoming.type, ["pop3", "imap", "nntp"]),
           incoming.port);
   return existing;
-};
+}
 
 /**
  * Check whether the user's setup already has an outgoing server
  * which matches (hostname, port, username) the primary one
  * in the config.
  *
  * @param config {AccountConfig} filled in (no placeholders)
  * @return {nsISmtpServer} If it already exists, the server
  *     object is returned.
  *     If it's a new server, |null| is returned.
  */
-function checkOutgoingServerAlreadyExists(config)
-{
+function checkOutgoingServerAlreadyExists(config) {
   assert(config instanceof AccountConfig);
   let smtpServers = MailServices.smtp.servers;
-  while (smtpServers.hasMoreElements())
-  {
+  while (smtpServers.hasMoreElements()) {
     let existingServer = smtpServers.getNext()
         .QueryInterface(Ci.nsISmtpServer);
     // TODO check username with full email address, too, like for incoming
     if (existingServer.hostname == config.outgoing.hostname &&
         existingServer.port == config.outgoing.port &&
         existingServer.username == config.outgoing.username)
       return existingServer;
   }
   return null;
-};
+}
 
 /**
  * Check if there already is a "Local Folders". If not, create it.
  * Copied from AccountWizard.js with minor updates.
  */
-function verifyLocalFoldersAccount(am)
-{
+function verifyLocalFoldersAccount(am) {
   let localMailServer;
   try {
     localMailServer = am.localFoldersServer;
-  }
-  catch (ex) {
+  } catch (ex) {
     localMailServer = null;
   }
 
   try {
-    if (!localMailServer)
-    {
+    if (!localMailServer) {
       // creates a copy of the identity you pass in
       am.createLocalMailAccount();
       try {
         localMailServer = am.localFoldersServer;
-      }
-      catch (ex) {
+      } catch (ex) {
         ddump("Error! we should have found the local mail server " +
               "after we created it.");
       }
     }
-  }
-  catch (ex) { ddump("Error in verifyLocalFoldersAccount " + ex); }
+  } catch (ex) { ddump("Error in verifyLocalFoldersAccount " + ex); }
 }
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -39,17 +39,17 @@ if (typeof gEmailWizardLogger == "undefi
   ChromeUtils.import("resource:///modules/gloda/log4moz.js");
   var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.wizard");
 }
 
 var gStringsBundle;
 var gMessengerBundle;
 var gBrandShortName;
 
-/*********************
+/** *******************
 TODO for bug 549045
 - autodetect protocol
 Polish
 - reformat code style to match
 <https://developer.mozilla.org/En/Mozilla_Coding_Style_Guide#Control_Structures>
 - bold status
 - remove status when user edited in manual edit
 - add and adapt test from bug 534588
@@ -70,74 +70,64 @@ Things to test (works for me):
     - when stopping [retest]: buttons proper?
   - enter nonsense domain. guess fails, (so automatically) manual,
     change domain to real one (not in DB), guess succeeds.
     former bug: goes to manual first shortly, then to result
 **********************/
 
 // To debug, set mail.wizard.logging.dump (or .console)="All" and kDebug = true
 
-function e(elementID)
-{
+function e(elementID) {
   return document.getElementById(elementID);
-};
+}
 
-function _hide(id)
-{
+function _hide(id) {
   e(id).hidden = true;
 }
 
-function _show(id)
-{
+function _show(id) {
   e(id).hidden = false;
 }
 
-function _enable(id)
-{
+function _enable(id) {
   e(id).disabled = false;
 }
 
-function _disable(id)
-{
+function _disable(id) {
   e(id).disabled = true;
 }
 
-function setText(id, value)
-{
+function setText(id, value) {
   var element = e(id);
   assert(element, "setText() on non-existant element ID");
 
   if (element.localName == "textbox" || element.localName == "label") {
     element.value = value;
   } else if (element.localName == "description") {
     element.textContent = value;
   } else {
     throw new NotReached("XUL element type not supported");
   }
 }
 
-function setLabelFromStringBundle(elementID, stringName)
-{
+function setLabelFromStringBundle(elementID, stringName) {
   e(elementID).label = gMessengerBundle.getString(stringName);
-};
+}
 
-function EmailConfigWizard()
-{
+function EmailConfigWizard() {
   this._init();
 }
 EmailConfigWizard.prototype =
 {
-  _init : function EmailConfigWizard__init()
-  {
+  _init: function EmailConfigWizard__init() {
     gEmailWizardLogger.info("Initializing setup wizard");
     this._abortable = null;
   },
 
-  onLoad : function()
-  {
+  onLoad() {
     /**
      * this._currentConfig is the config we got either from the XML file or
      * from guessing or from the user. Unless it's from the user, it contains
      * placeholders like %EMAILLOCALPART% in username and other fields.
      *
      * The config here must retain these placeholders, to be able to
      * adapt when the user enters a different realname, or password or
      * email local part. (A change of the domain name will trigger a new
@@ -146,17 +136,17 @@ EmailConfigWizard.prototype =
      * account or to show it to the user), you need to run replaceVariables().
      */
     this._currentConfig = null;
 
     let userFullname;
     try {
       let userInfo = Cc["@mozilla.org/userinfo;1"].getService(Ci.nsIUserInfo);
       userFullname = userInfo.fullname;
-    } catch(e) {
+    } catch (e) {
       // nsIUserInfo may not be implemented on all platforms, and name might
       // not be available even if it is.
     }
 
     this._domain = "";
     this._email = "";
     this._realname = (userFullname) ? userFullname : "";
     e("realname").value = this._realname;
@@ -261,26 +251,25 @@ EmailConfigWizard.prototype =
    *    "manual-edit-have-hostname" : user entered a hostname for both servers
    *        that we can use
    *    "manual-edit-testing" : User pressed the [Re-test] button and
    *         we're currently detecting the "Auto" values
    *    "manual-edit-complete" : user entered (or we tested) all necessary
    *         values, and we're ready to create to account
    * Currently, this doesn't cover the warning dialogs etc.. It may later.
    */
-  switchToMode : function(modename)
-  {
+  switchToMode(modename) {
     if (modename == this._currentModename) {
       return;
     }
     this._currentModename = modename;
-    gEmailWizardLogger.info("switching to UI mode " + modename)
+    gEmailWizardLogger.info("switching to UI mode " + modename);
 
-    //_show("initialSettings"); always visible
-    //_show("cancel_button"); always visible
+    // _show("initialSettings"); always visible
+    // _show("cancel_button"); always visible
     if (modename == "start") {
       _hide("status_area");
       _hide("result_area");
       _hide("manual-edit_area");
 
       _show("next_button");
       _disable("next_button"); // will be enabled by code
       _hide("half-manual-test_button");
@@ -385,90 +374,82 @@ EmailConfigWizard.prototype =
       }
     }
     window.sizeToContent();
   },
 
   /**
    * Start from beginning with possibly new email address.
    */
-  onStartOver : function()
-  {
+  onStartOver() {
     if (this._abortable) {
       this.onStop();
     }
     this.switchToMode("start");
   },
 
-  getConcreteConfig : function()
-  {
+  getConcreteConfig() {
     var result = this._currentConfig.copy();
     replaceVariables(result, this._realname, this._email, this._password);
     result.rememberPassword = e("remember_password").checked &&
                               !!this._password;
     return result;
   },
 
   /*
    * This checks if the email address is at least possibly valid, meaning it
    * has an '@' before the last char.
    */
-  validateEmailMinimally : function(emailAddr)
-  {
+  validateEmailMinimally(emailAddr) {
     let atPos = emailAddr.lastIndexOf("@");
     return atPos > 0 && atPos + 1 < emailAddr.length;
   },
 
   /*
    * This checks if the email address is syntactically valid,
    * as far as we can determine. We try hard to make full checks.
    *
    * OTOH, we have a very small chance of false negatives,
    * because the RFC822 address spec is insanely complicated,
    * but rarely needed, so when this here fails, we show an error message,
    * but don't stop the user from continuing.
    * In contrast, if validateEmailMinimally() fails, we stop the user.
    */
-  validateEmail : function(emailAddr)
-  {
+  validateEmail(emailAddr) {
     return emailRE.test(emailAddr);
   },
 
   /**
    * onInputEmail and onInputRealname are called on input = keypresses, and
    * enable/disable the next button based on whether there's a semi-proper
    * e-mail address and non-blank realname to start with.
    *
    * A change to the email address also automatically restarts the
    * whole process.
    */
-  onInputEmail : function()
-  {
+  onInputEmail() {
     this._email = e("email").value;
     this.onStartOver();
     this.checkStartDone();
   },
-  onInputRealname : function()
-  {
+  onInputRealname() {
     this._realname = e("realname").value;
     this.checkStartDone();
   },
 
-  onInputPassword : function()
-  {
+  onInputPassword() {
     this._password = e("password").value;
   },
 
   /**
    * This does very little other than to check that a name was entered at all
    * Since this is such an insignificant test we should be using a very light
    * or even jovial warning.
    */
-  onBlurRealname : function()
-  {
+  onBlurRealname() {
     let realnameEl = e("realname");
     if (this._realname) {
       this.clearError("nameerror");
       _show("nametext");
       realnameEl.removeAttribute("error");
     // bug 638790: don't show realname error until user enter an email address
     } else if (this.validateEmailMinimally(this._email)) {
       _hide("nametext");
@@ -477,18 +458,17 @@ EmailConfigWizard.prototype =
     }
   },
 
   /**
    * This check is only done as an informative warning.
    * We don't want to block the person, if they've entered an email address
    * that doesn't conform to our regex.
    */
-  onBlurEmail : function()
-  {
+  onBlurEmail() {
     if (!this._email) {
       return;
     }
     var emailEl = e("email");
     if (this.validateEmail(this._email)) {
       this.clearError("emailerror");
       emailEl.removeAttribute("error");
       this.onBlurRealname();
@@ -498,66 +478,61 @@ EmailConfigWizard.prototype =
     }
   },
 
   /**
    * If the user just tabbed through the password input without entering
    * anything, set the type back to text so we don't wind up showing the
    * emptytext as bullet characters.
    */
-  onBlurPassword : function()
-  {
+  onBlurPassword() {
     if (!this._password) {
       e("password").type = "text";
     }
   },
 
   /**
    * @see onBlurPassword()
    */
-  onFocusPassword : function()
-  {
+  onFocusPassword() {
     e("password").type = "password";
   },
 
   /**
    * Check whether the user entered the minimum of information
    * needed to leave the "start" mode (entering of name, email, pw)
    * and is allowed to proceed to detection step.
    */
-  checkStartDone : function()
-  {
+  checkStartDone() {
     if (this.validateEmailMinimally(this._email) &&
         this._realname) {
       this._domain = this._email.split("@")[1].toLowerCase();
       _enable("next_button");
     } else {
       _disable("next_button");
     }
   },
 
   /**
    * When the [Continue] button is clicked, we move from the initial account
    * information stage to using that information to configure account details.
    */
-  onNext : function()
-  {
+  onNext() {
     this.findConfig(this._domain, this._email);
   },
 
 
-  /////////////////////////////////////////////////////////////////
+  // ///////////////////////////////////////////////////////////////
   // Detection step
 
   /**
    * Try to find an account configuration for this email address.
    * This is the function which runs the autoconfig.
    */
-  findConfig : function(domain, email)
-  {
+  findConfig(domain, email) {
     gEmailWizardLogger.info("findConfig()");
     if (this._abortable) {
       this.onStop();
     }
     this.switchToMode("find-config");
     this.startSpinner("looking_up_settings_disk");
     var self = this;
     this._abortable = fetchConfigFromDisk(domain,
@@ -625,25 +600,24 @@ EmailConfigWizard.prototype =
               });
           });
       });
   },
 
   /**
    * Just a continuation of findConfig()
    */
-  _guessConfig : function(domain, initialConfig)
-  {
-    this.startSpinner("looking_up_settings_guess")
+  _guessConfig(domain, initialConfig) {
+    this.startSpinner("looking_up_settings_guess");
     var self = this;
     self._abortable = guessConfig(domain,
       function(type, hostname, port, ssl, done, config) // progress
       {
         gEmailWizardLogger.info("progress callback host " + hostname +
-                                " port " +  port + " type " + type);
+                                " port " + port + " type " + type);
       },
       function(config) // success
       {
         self._abortable = null;
         self.foundConfig(config);
         self.stopSpinner(Services.io.offline ?
                          "guessed_settings_offline" : "found_settings_guess");
         window.sizeToContent();
@@ -660,153 +634,141 @@ EmailConfigWizard.prototype =
       },
       initialConfig, "both");
   },
 
   /**
    * When findConfig() was successful, it calls this.
    * This displays the config to the user.
    */
-  foundConfig : function(config)
-  {
+  foundConfig(config) {
     gEmailWizardLogger.info("foundConfig()");
     assert(config instanceof AccountConfig,
         "BUG: Arg 'config' needs to be an AccountConfig object");
 
     this._haveValidConfigForDomain = this._email.split("@")[1];
 
     if (!this._realname || !this._email) {
       return;
     }
     this._foundConfig2(config);
   },
 
   // Continuation of foundConfig2() after custom fields.
-  _foundConfig2 : function(config)
-  {
+  _foundConfig2(config) {
     this.displayConfigResult(config);
   },
 
   /**
    * [Stop] button click handler.
    * This allows the user to abort any longer operation, esp. network activity.
    * We currently have 3 such cases here:
    * 1. findConfig(), i.e. fetch config from DB, guessConfig etc.
    * 2. onHalfManualTest(), i.e. the [Retest] button in manual config.
    * 3. verifyConfig() - We can't stop this yet, so irrelevant here currently.
    * Given that these need slightly different actions, this function will be set
    * to a function (i.e. overwritten) by whoever enables the stop button.
    *
    * We also call this from the code when the user started a different action
    * without explicitly clicking [Stop] for the old one first.
    */
-  onStop : function()
-  {
+  onStop() {
     throw new NotReached("onStop should be overridden by now");
   },
-  _onStopCommon : function()
-  {
+  _onStopCommon() {
     if (!this._abortable) {
       throw new NotReached("onStop called although there's nothing to stop");
     }
     gEmailWizardLogger.info("onStop cancelled _abortable");
     this._abortable.cancel(new UserCancelledException());
     this._abortable = null;
     this.stopSpinner();
   },
-  onStopFindConfig : function()
-  {
+  onStopFindConfig() {
     this._onStopCommon();
     this.switchToMode("start");
     this.checkStartDone();
   },
-  onStopHalfManualTesting : function()
-  {
+  onStopHalfManualTesting() {
     this._onStopCommon();
     this.validateManualEditComplete();
   },
 
 
 
-  ///////////////////////////////////////////////////////////////////
+  // /////////////////////////////////////////////////////////////////
   // status area
 
-  startSpinner : function(actionStrName)
-  {
+  startSpinner(actionStrName) {
     e("status_area").setAttribute("status", "loading");
     gEmailWizardLogger.warn("spinner start " + actionStrName);
     this._showStatusTitle(actionStrName);
   },
 
-  stopSpinner : function(actionStrName)
-  {
+  stopSpinner(actionStrName) {
     e("status_area").setAttribute("status", "result");
     _hide("stop_button");
     this._showStatusTitle(actionStrName);
     gEmailWizardLogger.warn("all spinner stop " + actionStrName);
   },
 
-  showErrorStatus : function(actionStrName)
-  {
+  showErrorStatus(actionStrName) {
     e("status_area").setAttribute("status", "error");
     gEmailWizardLogger.warn("status error " + actionStrName);
     this._showStatusTitle(actionStrName);
   },
 
-  _showStatusTitle : function(msgName)
-  {
+  _showStatusTitle(msgName) {
     let msg = " "; // assure height. Do via min-height in CSS, for 2 lines?
     try {
       if (msgName) {
         msg = gStringsBundle.getFormattedString(msgName, [gBrandShortName]);
       }
-    } catch(ex) {
+    } catch (ex) {
       gEmailWizardLogger.error("missing string for " + msgName);
       msg = msgName + " (missing string in translation!)";
     }
 
     e("status_msg").textContent = msg;
     gEmailWizardLogger.info("status msg: " + msg);
   },
 
 
 
-  /////////////////////////////////////////////////////////////////
+  // ///////////////////////////////////////////////////////////////
   // Result area
 
   /**
    * Displays a (probed) config to the user,
    * in the result config details area.
    *
    * @param config {AccountConfig} The config to present to user
    */
-  displayConfigResult : function(config)
-  {
+  displayConfigResult(config) {
     assert(config instanceof AccountConfig);
     this._currentConfig = config;
     var configFilledIn = this.getConcreteConfig();
 
     var unknownString = gStringsBundle.getString("resultUnknown");
 
-    function _makeHostDisplayString(server, stringName)
-    {
+    function _makeHostDisplayString(server, stringName) {
       let type = gStringsBundle.getString(sanitize.translate(server.type,
-          { imap : "resultIMAP", pop3 : "resultPOP3", smtp : "resultSMTP" }),
+          { imap: "resultIMAP", pop3: "resultPOP3", smtp: "resultSMTP" }),
           unknownString);
       let host = server.hostname +
           (isStandardPort(server.port) ? "" : ":" + server.port);
       let ssl = gStringsBundle.getString(sanitize.translate(server.socketType,
-          { 1 : "resultNoEncryption", 2 : "resultSSL", 3 : "resultSTARTTLS" }),
+          { 1: "resultNoEncryption", 2: "resultSSL", 3: "resultSTARTTLS" }),
           unknownString);
       let certStatus = gStringsBundle.getString(server.badCert ?
           "resultSSLCertWeak" : "resultSSLCertOK");
       // TODO: we should really also display authentication method here.
       return gStringsBundle.getFormattedString(stringName,
           [ type, host, ssl, certStatus ]);
-    };
+    }
 
     var incomingResult = unknownString;
     if (configFilledIn.incoming.hostname) {
       incomingResult = _makeHostDisplayString(configFilledIn.incoming,
           "resultIncoming");
     }
 
     var outgoingResult = unknownString;
@@ -864,44 +826,42 @@ EmailConfigWizard.prototype =
    * Handle the user switching between IMAP and POP3 settings using the
    * radio buttons.
    *
    * Note: This function must only be called by user action, not by setting
    *       the value or selectedItem or selectedIndex of the radiogroup!
    *       This is why we use the oncommand attribute of the radio elements
    *       instead of the onselect attribute of the radiogroup.
    */
-  onResultIMAPOrPOP3 : function()
-  {
+  onResultIMAPOrPOP3() {
     var config = this._currentConfig;
     var radiogroup = e("result_imappop");
     // add current server as best alternative to start of array
     config.incomingAlternatives.unshift(config.incoming);
     // use selected server (stored as special property on the <radio> node)
     config.incoming = radiogroup.selectedItem.configIncoming;
     // remove newly selected server from list of alternatives
     config.incomingAlternatives = config.incomingAlternatives.filter(
         function(e) { return e != config.incoming; });
     this.displayConfigResult(config);
   },
 
 
 
-  /////////////////////////////////////////////////////////////////
+  // ///////////////////////////////////////////////////////////////
   // Manual Edit area
 
   /**
    * Gets the values from the user in the manual edit area.
    *
    * Realname and password are not part of that area and still
    * placeholders, but hostname and username are concrete and
    * no placeholders anymore.
    */
-  getUserConfig : function()
-  {
+  getUserConfig() {
     var config = this.getConcreteConfig();
     if (!config) {
       config = new AccountConfig();
     }
     config.source = AccountConfig.kSourceUser;
 
     // Incoming server
     try {
@@ -911,17 +871,17 @@ EmailConfigWizard.prototype =
     } catch (e) { gEmailWizardLogger.warn(e); }
     try {
       config.incoming.port = sanitize.integerRange(e("incoming_port").value,
                                                    kMinPort, kMaxPort);
     } catch (e) {
       config.incoming.port = undefined; // incl. default "Auto"
     }
     config.incoming.type = sanitize.translate(e("incoming_protocol").value,
-        { 1: "imap", 2 : "pop3", 0 : null });
+        { 1: "imap", 2: "pop3", 0: null });
     config.incoming.socketType = sanitize.integer(e("incoming_ssl").value);
     config.incoming.auth = sanitize.integer(e("incoming_authMethod").value);
     config.incoming.username = e("incoming_username").value;
 
     // Outgoing server
 
     // Did the user select one of the already configured SMTP servers from the
     // drop-down list? If so, use it.
@@ -957,32 +917,30 @@ EmailConfigWizard.prototype =
   },
 
   /**
    * [Manual Config] button click handler. This turns the config details area
    * into an editable form and makes the (Go) button appear. The edit button
    * should only be available after the config probing is completely finished,
    * replacing what was the (Stop) button.
    */
-  onManualEdit : function()
-  {
+  onManualEdit() {
     if (this._abortable) {
       this.onStop();
     }
     this.editConfigDetails();
   },
 
   /**
    * Setting the config details form so it can be edited. We also disable
    * (and hide) the create button during this time because we don't know what
    * might have changed. The function called from the button that restarts
    * the config check should be enabling the config button as needed.
    */
-  editConfigDetails : function()
-  {
+  editConfigDetails() {
     gEmailWizardLogger.info("manual edit");
 
     if (!this._currentConfig) {
       this._currentConfig = new AccountConfig();
       this._currentConfig.incoming.type = "imap";
       this._currentConfig.incoming.username = "%EMAILLOCALPART%";
       this._currentConfig.outgoing.username = "%EMAILLOCALPART%";
       this._currentConfig.incoming.hostname = ".%EMAILDOMAIN%";
@@ -999,23 +957,22 @@ EmailConfigWizard.prototype =
     // so calling it explicitly again. Doesn't do harm, speed is irrelevant.
     this.validateManualEditComplete();
   },
 
   /**
    * Fills the manual edit textfields with the provided config.
    * @param config {AccountConfig} The config to present to user
    */
-  _fillManualEditFields : function(config)
-  {
+  _fillManualEditFields(config) {
     assert(config instanceof AccountConfig);
 
     // incoming server
     e("incoming_protocol").value = sanitize.translate(config.incoming.type,
-                                                { "imap" : 1, "pop3" : 2 }, 1);
+                                                { "imap": 1, "pop3": 2 }, 1);
     e("incoming_hostname").value = config.incoming.hostname;
     e("incoming_ssl").value = sanitize.enum(config.incoming.socketType,
                                             [ 0, 1, 2, 3 ], 0);
     e("incoming_authMethod").value = sanitize.enum(config.incoming.auth,
                                                    [ 0, 3, 4, 5, 6, 10 ], 0);
     e("incoming_username").value = config.incoming.username;
     if (config.incoming.port) {
       e("incoming_port").value = config.incoming.port;
@@ -1082,18 +1039,17 @@ EmailConfigWizard.prototype =
     this.onChangedOutgoingDropdown(); // show/hide outgoing port, SSL, ...
   },
 
   /**
    * Automatically fill port field in manual edit,
    * unless user entered a non-standard port.
    * @param config {AccountConfig}
    */
-  adjustIncomingPortToSSLAndProtocol : function(config)
-  {
+  adjustIncomingPortToSSLAndProtocol(config) {
     var autoPort = gStringsBundle.getString("port_auto");
     var incoming = config.incoming;
     // we could use getHostEntry() here, but that API is bad, so don't bother
     var newInPort = undefined;
     if (!incoming.port || isStandardPort(incoming.port)) {
       if (incoming.type == "imap") {
         if (incoming.socketType == 1 || incoming.socketType == 3) {
           newInPort = 143;
@@ -1116,18 +1072,17 @@ EmailConfigWizard.prototype =
       e("incoming_port").value = newInPort;
       e("incoming_authMethod").value = 0; // auto
     }
   },
 
   /**
    * @see adjustIncomingPortToSSLAndProtocol()
    */
-  adjustOutgoingPortToSSLAndProtocol : function(config)
-  {
+  adjustOutgoingPortToSSLAndProtocol(config) {
     var autoPort = gStringsBundle.getString("port_auto");
     var outgoing = config.outgoing;
     var newOutPort = undefined;
     if (!outgoing.port || isStandardPort(outgoing.port)) {
       if (outgoing.socketType == 1 || outgoing.socketType == 3) {
         // standard port is 587 *or* 25, so set to auto
         // unless user or config already entered one of these two ports.
         if (outgoing.port != 25 && outgoing.port != 587) {
@@ -1145,18 +1100,17 @@ EmailConfigWizard.prototype =
     }
   },
 
   /**
    * If the user changed the port manually, adjust the SSL value,
    * (only) if the new port is impossible with the old SSL value.
    * @param config {AccountConfig}
    */
-  adjustIncomingSSLToPort : function(config)
-  {
+  adjustIncomingSSLToPort(config) {
     var incoming = config.incoming;
     var newInSocketType = undefined;
     if (!incoming.port || // auto
         !isStandardPort(incoming.port)) {
       return;
     }
     if (incoming.type == "imap") {
       // normal SSL impossible
@@ -1179,18 +1133,17 @@ EmailConfigWizard.prototype =
       e("incoming_ssl").value = newInSocketType;
       e("incoming_authMethod").value = 0; // auto
     }
   },
 
   /**
    * @see adjustIncomingSSLToPort()
    */
-  adjustOutgoingSSLToPort : function(config)
-  {
+  adjustOutgoingSSLToPort(config) {
     var outgoing = config.outgoing;
     var newOutSocketType = undefined;
     if (!outgoing.port || // auto
         !isStandardPort(outgoing.port)) {
       return;
     }
     // normal SSL impossible
     if ((outgoing.port == 587 || outgoing.port == 25) &&
@@ -1206,113 +1159,100 @@ EmailConfigWizard.prototype =
     }
   },
 
   /**
    * Sets the prefilled values of the port fields.
    * Filled statically with the standard ports for the given protocol,
    * plus "Auto".
    */
-  fillPortDropdown : function(protocolType)
-  {
+  fillPortDropdown(protocolType) {
     var menu = e(protocolType == "smtp" ? "outgoing_port" : "incoming_port");
 
     // menulist.removeAllItems() is nice, but nicely clears the user value, too
     var popup = menu.menupopup;
     while (popup.hasChildNodes())
       popup.lastChild.remove();
 
     // add standard ports
     var autoPort = gStringsBundle.getString("port_auto");
     menu.appendItem(autoPort, autoPort, ""); // label,value,descr
     for (let port of getStandardPorts(protocolType)) {
       menu.appendItem(port, port, ""); // label,value,descr
     }
   },
 
-  onChangedProtocolIncoming : function()
-  {
+  onChangedProtocolIncoming() {
     var config = this.getUserConfig();
     this.adjustIncomingPortToSSLAndProtocol(config);
     this.fillPortDropdown(config.incoming.type);
     this.onChangedManualEdit();
   },
-  onChangedPortIncoming : function()
-  {
+  onChangedPortIncoming() {
     gEmailWizardLogger.info("incoming port changed");
     this.adjustIncomingSSLToPort(this.getUserConfig());
     this.onChangedManualEdit();
   },
-  onChangedPortOutgoing : function()
-  {
+  onChangedPortOutgoing() {
     gEmailWizardLogger.info("outgoing port changed");
     this.adjustOutgoingSSLToPort(this.getUserConfig());
     this.onChangedManualEdit();
   },
-  onChangedSSLIncoming : function()
-  {
+  onChangedSSLIncoming() {
     this.adjustIncomingPortToSSLAndProtocol(this.getUserConfig());
     this.onChangedManualEdit();
   },
-  onChangedSSLOutgoing : function()
-  {
+  onChangedSSLOutgoing() {
     this.adjustOutgoingPortToSSLAndProtocol(this.getUserConfig());
     this.onChangedManualEdit();
   },
-  onChangedInAuth : function()
-  {
+  onChangedInAuth() {
     this.onChangedManualEdit();
   },
-  onChangedOutAuth : function(aSelectedAuth)
-  {
+  onChangedOutAuth(aSelectedAuth) {
     if (aSelectedAuth) {
       e("outgoing_label").hidden = e("outgoing_username").hidden =
                                    (aSelectedAuth.id == "out-authMethod-no");
     }
     this.onChangedManualEdit();
   },
-  onInputInUsername : function()
-  {
+  onInputInUsername() {
     if (this.sameInOutUsernames)
       e("outgoing_username").value = e("incoming_username").value;
     this.onChangedManualEdit();
   },
-  onInputOutUsername : function()
-  {
+  onInputOutUsername() {
     this.sameInOutUsernames = false;
     this.onChangedManualEdit();
   },
-  onInputHostname : function()
-  {
+  onInputHostname() {
     this.onChangedManualEdit();
   },
 
   /**
    * Sets the label of the first entry of the dropdown which represents
    * the new outgoing server.
    */
-  onOpenOutgoingDropdown : function()
-  {
+  onOpenOutgoingDropdown() {
     var menulist = e("outgoing_hostname");
     // If the menulist is not editable, there is nothing to update
     // and menulist.inputField does not even exist.
     if (!menulist.editable)
       return;
 
     var menuitem = menulist.getItemAtIndex(0);
     assert(!menuitem.serverKey, "I wanted the special item for the new host");
     menuitem.label = menulist.inputField.value;
   },
 
   /**
    * User selected an existing SMTP server (or deselected it).
    * This changes only the UI. The values are read in getUserConfig().
    */
-  onChangedOutgoingDropdown : function()
-  {
+  onChangedOutgoingDropdown() {
     var menulist = e("outgoing_hostname");
     var menuitem = menulist.selectedItem;
     if (menuitem && menuitem.serverKey) {
       // an existing server has been selected from the dropdown
       menulist.editable = false;
       _hide("outgoing_port");
       _hide("outgoing_ssl");
       _hide("outgoing_authMethod");
@@ -1322,18 +1262,17 @@ EmailConfigWizard.prototype =
       _show("outgoing_port");
       _show("outgoing_ssl");
       _show("outgoing_authMethod");
     }
 
     this.onChangedManualEdit();
   },
 
-  onChangedManualEdit : function()
-  {
+  onChangedManualEdit() {
     if (this._abortable) {
       this.onStop();
     }
     this.validateManualEditComplete();
   },
 
   /**
    * This enables the buttons which allow the user to proceed
@@ -1345,18 +1284,17 @@ EmailConfigWizard.prototype =
    * which allows to press [Re-test], which starts the detection
    * of the other values.
    * Once the user has entered (or we detected) all values, he may
    * do [Create Account] (tests login and if successful creates the account)
    * or [Advanced Setup] (goes to Account Manager). Esp. in the latter case,
    * we will not second-guess his setup and just to as told, so here we make
    * sure that he at least entered all values.
    */
-  validateManualEditComplete : function()
-  {
+  validateManualEditComplete() {
     // getUserConfig() is expensive, but still OK, not a problem
     var manualConfig = this.getUserConfig();
     this._currentConfig = manualConfig;
     if (manualConfig.isComplete()) {
       this.switchToMode("manual-edit-complete");
     } else if (!!manualConfig.incoming.hostname &&
                !!manualConfig.outgoing.hostname) {
       this.switchToMode("manual-edit-have-hostname");
@@ -1364,39 +1302,37 @@ EmailConfigWizard.prototype =
       this.switchToMode("manual-edit");
     }
   },
 
   /**
    * [Switch to provisioner] button click handler. Always active, allows
    * one to switch to the account provisioner screen.
    */
-  onSwitchToProvisioner : function ()
-  {
+  onSwitchToProvisioner() {
     // We have to close this window first, otherwise msgNewMailAccount
     // in accountUtils.js will think that this window still
     // exists when it's called from the account provisioner window.
     // This is because the account provisioner window is modal,
     // and therefore blocks.  Therefore, we override the _okCallback
     // with a function that spawns the account provisioner, and then
     // close the window.
     this._okCallback = function() {
       NewMailAccountProvisioner(window.arguments[0].msgWindow, window.arguments[0].extraData);
-    }
+    };
     window.close();
   },
 
   /**
    * [Advanced Setup...] button click handler
    * Only active in manual edit mode, and goes straight into
    * Account Settings (pref UI) dialog. Requires a backend account,
    * which requires proper hostname, port and protocol.
    */
-  onAdvancedSetup : function()
-  {
+  onAdvancedSetup() {
     assert(this._currentConfig instanceof AccountConfig);
     let configFilledIn = this.getConcreteConfig();
 
     if (checkIncomingServerAlreadyExists(configFilledIn)) {
       alertPrompt(gStringsBundle.getString("error_creating_account"),
                   gStringsBundle.getString("incoming_server_exists"));
       return;
     }
@@ -1422,29 +1358,28 @@ EmailConfigWizard.prototype =
    * Restarts the config guessing process after a person editing the server
    * fields.
    * It's called "half-manual", because we take the user-entered values
    * as given and will not second-guess them, to respect the user wishes.
    * (Yes, Sir! Will do as told!)
    * The values that the user left empty or on "Auto" will be guessed/probed
    * here. We will also check that the user-provided values work.
    */
-  onHalfManualTest : function()
-  {
+  onHalfManualTest() {
     var newConfig = this.getUserConfig();
     gEmailWizardLogger.info(debugObject(newConfig, "manualConfigToTest"));
     this.startSpinner("looking_up_settings_halfmanual");
     this.switchToMode("manual-edit-testing");
     // if (this._userPickedOutgoingServer) TODO
     var self = this;
     this._abortable = guessConfig(this._domain,
       function(type, hostname, port, ssl, done, config) // progress
       {
         gEmailWizardLogger.info("progress callback host " + hostname +
-                                " port " +  port + " type " + type);
+                                " port " + port + " type " + type);
       },
       function(config) // success
       {
         self._abortable = null;
         self._fillManualEditFields(config);
         self.switchToMode("manual-edit-complete");
         self.stopSpinner("found_settings_halfmanual");
       },
@@ -1459,53 +1394,49 @@ EmailConfigWizard.prototype =
         self.switchToMode("manual-edit-have-hostname");
       },
       newConfig,
       newConfig.outgoing.existingServerKey ? "incoming" : "both");
   },
 
 
 
-  /////////////////////////////////////////////////////////////////
+  // ///////////////////////////////////////////////////////////////
   // UI helper functions
 
-  _prefillConfig : function(initialConfig)
-  {
+  _prefillConfig(initialConfig) {
     var emailsplit = this._email.split("@");
     assert(emailsplit.length > 1);
     var emaillocal = sanitize.nonemptystring(emailsplit[0]);
     initialConfig.incoming.username = emaillocal;
     initialConfig.outgoing.username = emaillocal;
     return initialConfig;
   },
 
-  clearError : function(which)
-  {
+  clearError(which) {
     _hide(which);
     _hide(which + "icon");
     e(which).textContent = "";
   },
 
-  setError : function(which, msg_name)
-  {
+  setError(which, msg_name) {
     try {
       _show(which);
       _show(which + "icon");
       e(which).textContent = gStringsBundle.getString(msg_name);
       window.sizeToContent();
     } catch (ex) { alertPrompt("missing error string", msg_name); }
   },
 
 
 
-  /////////////////////////////////////////////////////////////////
+  // ///////////////////////////////////////////////////////////////
   // Finish & dialog close functions
 
-  onKeyDown : function(event)
-  {
+  onKeyDown(event) {
     let key = event.keyCode;
     if (key == 27) { // Escape key
       this.onCancel();
       return true;
     }
     if (key == 13) { // OK key
       let buttons = [
         { id: "next_button", action: makeCallback(this, this.onNext) },
@@ -1520,37 +1451,34 @@ EmailConfigWizard.prototype =
         }
         button.action();
         return true;
       }
     }
     return false;
   },
 
-  onCancel : function()
-  {
+  onCancel() {
     window.close();
     // The window onclose handler will call onWizardShutdown for us.
   },
 
-  onWizardShutdown : function()
-  {
+  onWizardShutdown() {
     if (this._abortable) {
       this._abortable.cancel(new UserCancelledException());
     }
 
     if (this._okCallback) {
       this._okCallback();
     }
     gEmailWizardLogger.info("Shutting down email config dialog");
   },
 
 
-  onCreate : function()
-  {
+  onCreate() {
     try {
       gEmailWizardLogger.info("Create button clicked");
 
       var configFilledIn = this.getConcreteConfig();
       var self = this;
       // If the dialog is not needed, it will go straight to OK callback
       gSecurityWarningDialog.open(this._currentConfig, configFilledIn, true,
         function() // on OK
@@ -1561,18 +1489,17 @@ EmailConfigWizard.prototype =
     } catch (ex) {
       gEmailWizardLogger.error("Error creating account.  ex=" + ex +
                                ", stack=" + ex.stack);
       alertPrompt(gStringsBundle.getString("error_creating_account"), ex);
     }
   },
 
   // called by onCreate()
-  validateAndFinish : function()
-  {
+  validateAndFinish() {
     var configFilledIn = this.getConcreteConfig();
 
     if (checkIncomingServerAlreadyExists(configFilledIn)) {
       alertPrompt(gStringsBundle.getString("error_creating_account"),
                   gStringsBundle.getString("incoming_server_exists"));
       return;
     }
 
@@ -1596,17 +1523,17 @@ EmailConfigWizard.prototype =
     // logic function defined in verifyConfig.js
     verifyConfig(
       configFilledIn,
       // guess login config?
       configFilledIn.source != AccountConfig.kSourceXML,
       // TODO Instead, the following line would be correct, but I cannot use it,
       // because some other code doesn't adhere to the expectations/specs.
       // Find out what it was and fix it.
-      //concreteConfig.source == AccountConfig.kSourceGuess,
+      // concreteConfig.source == AccountConfig.kSourceGuess,
       this._parentMsgWindow,
       function(successfulConfig) // success
       {
         self.stopSpinner(successfulConfig.incoming.password ?
                          "password_ok" : null);
 
         // the auth might have changed, so we
         // should back-port it to the current config.
@@ -1632,73 +1559,68 @@ EmailConfigWizard.prototype =
         // give user something to proceed after fixing
         _enable("create_button");
         // hidden in non-manual mode, so it's fine to enable
         _enable("half-manual-test_button");
         _enable("advanced-setup_button");
       });
   },
 
-  finish : function()
-  {
+  finish() {
     gEmailWizardLogger.info("creating account in backend");
     createAccountInBackend(this.getConcreteConfig());
     window.close();
   },
 };
 
 var gEmailConfigWizard = new EmailConfigWizard();
 
-function serverMatches(a, b)
-{
+function serverMatches(a, b) {
   return a.type == b.type &&
          a.hostname == b.hostname &&
          a.port == b.port &&
          a.socketType == b.socketType &&
          a.auth == b.auth;
 }
 
 var _gStandardPorts = {};
-_gStandardPorts["imap"] = [ 143, 993 ];
-_gStandardPorts["pop3"] = [ 110, 995 ];
-_gStandardPorts["smtp"] = [ 587, 25, 465 ]; // order matters
-var _gAllStandardPorts = _gStandardPorts["smtp"]
-    .concat(_gStandardPorts["imap"]).concat(_gStandardPorts["pop3"]);
+_gStandardPorts.imap = [ 143, 993 ];
+_gStandardPorts.pop3 = [ 110, 995 ];
+_gStandardPorts.smtp = [ 587, 25, 465 ]; // order matters
+var _gAllStandardPorts = _gStandardPorts.smtp
+    .concat(_gStandardPorts.imap).concat(_gStandardPorts.pop3);
 
-function isStandardPort(port)
-{
+function isStandardPort(port) {
   return _gAllStandardPorts.indexOf(port) != -1;
 }
 
-function getStandardPorts(protocolType)
-{
+function getStandardPorts(protocolType) {
   return _gStandardPorts[protocolType];
 }
 
 
 /**
  * Warning dialog, warning user about lack of, or inappropriate, encryption.
  *
  * This is effectively a separate dialog, but implemented as part of
  * this dialog. It works by hiding the main dialog part and unhiding
  * the this part, and vice versa, and resizing the dialog.
  */
-function SecurityWarningDialog()
-{
+function SecurityWarningDialog() {
   this._acknowledged = new Array();
 }
 SecurityWarningDialog.prototype =
 {
   /**
    * {Array of {(incoming or outgoing) server part of {AccountConfig}}
    * A list of the servers for which we already showed this dialog and the
    * user approved the configs. For those, we won't show the warning again.
    * (Make sure to store a copy in case the underlying object is changed.)
    */
-  _acknowledged : null,
+  _acknowledged: null,
 
   _inSecurityBad:  0x0001,
   _inCertBad:      0x0010,
   _outSecurityBad: 0x0100,
   _outCertBad:     0x1000,
 
   /**
    * Checks whether we need to warn about this config.
@@ -1715,18 +1637,17 @@ SecurityWarningDialog.prototype =
    * (Given that this dialog object is static/global and persistent,
    * we can store that approval state here in this object.)
    *
    * @param configSchema @see open()
    * @param configFilledIn @see open()
    * @returns {Boolean}   true when the dialog should be shown
    *      (call open()). if false, the dialog can and should be skipped.
    */
-  needed : function(configSchema, configFilledIn)
-  {
+  needed(configSchema, configFilledIn) {
     assert(configSchema instanceof AccountConfig);
     assert(configFilledIn instanceof AccountConfig);
     assert(configSchema.isComplete());
     assert(configFilledIn.isComplete());
 
     var incomingBad = ((configFilledIn.incoming.socketType > 1) ? 0 : this._inSecurityBad) |
                       ((configFilledIn.incoming.badCert) ? this._inCertBad : 0);
     var outgoingBad = 0;
@@ -1767,29 +1688,28 @@ SecurityWarningDialog.prototype =
    * @param onlyIfNeeded {Boolean}   If there is nothing to warn about,
    *     call okCallback() immediately (and sync).
    * @param okCallback {function(config {AccountConfig})}
    *      Called when the user clicked OK and approved the config including
    *      the warnings. |config| is without placeholders replaced.
    * @param cancalCallback {function()}
    *      Called when the user decided to heed the warnings and not approve.
    */
-  open : function(configSchema, configFilledIn, onlyIfNeeded,
-                  okCallback, cancelCallback)
-  {
+  open(configSchema, configFilledIn, onlyIfNeeded,
+                  okCallback, cancelCallback) {
     assert(typeof(okCallback) == "function");
     assert(typeof(cancelCallback) == "function");
     // needed() also checks the parameters
     var needed = this.needed(configSchema, configFilledIn);
     if ((needed == 0) && onlyIfNeeded) {
       okCallback();
       return;
     }
 
-    assert(needed > 0 , "security dialog opened needlessly");
+    assert(needed > 0, "security dialog opened needlessly");
     this._currentConfigFilledIn = configFilledIn;
     this._okCallback = okCallback;
     this._cancelCallback = cancelCallback;
     var incoming = configFilledIn.incoming;
     var outgoing = configFilledIn.outgoing;
 
     _hide("mastervbox");
     _show("warningbox");
@@ -1834,62 +1754,58 @@ SecurityWarningDialog.prototype =
     }
     _show("acknowledge_warning");
     assert(!e("incoming_box").hidden || !e("outgoing_box").hidden,
            "warning dialog shown for unknown reason");
 
     window.sizeToContent();
   },
 
-  toggleDetails : function (id)
-  {
+  toggleDetails(id) {
     let details = e(id + "_details");
     let tech = e(id + "_technical");
     if (details.getAttribute("collapsed")) {
       details.removeAttribute("collapsed");
       tech.setAttribute("expanded", true);
     } else {
       details.setAttribute("collapsed", true);
       tech.removeAttribute("expanded");
     }
   },
 
   /**
    * user checked checkbox that he understood it and wishes
    * to ignore the warning.
    */
-  toggleAcknowledge : function()
-  {
+  toggleAcknowledge() {
     if (e("acknowledge_warning").checked) {
       _enable("iknow");
     } else {
       _disable("iknow");
     }
   },
 
   /**
    * [Cancel] button pressed. Get me out of here!
    */
-  onCancel : function()
-  {
+  onCancel() {
     _hide("warningbox");
     _show("mastervbox");
     window.sizeToContent();
 
     this._cancelCallback();
   },
 
   /**
    * [OK] button pressed.
    * Implies that the user toggled the acknowledge checkbox,
    * i.e. approved the config and ignored the warnings,
    * otherwise the button would have been disabled.
    */
-  onOK : function()
-  {
+  onOK() {
     assert(e("acknowledge_warning").checked);
 
     var overrideOK = this.showCertOverrideDialog(this._currentConfigFilledIn);
     if (!overrideOK) {
       this.onCancel();
       return;
     }
 
@@ -1915,46 +1831,45 @@ SecurityWarningDialog.prototype =
    *
    * @param config {AccountConfig} concrete
    * @returns true, if all certs are fine or the user accepted them.
    *     false, if the user cancelled.
    *
    * static function
    * sync function: blocks until the dialog is closed.
    */
-  showCertOverrideDialog : function(config)
-  {
+  showCertOverrideDialog(config) {
     if (config.incoming.socketType > 1 && // SSL or STARTTLS
         config.incoming.badCert) {
       var params = {
-        exceptionAdded : false,
-        prefetchCert : true,
-        location : config.incoming.targetSite,
+        exceptionAdded: false,
+        prefetchCert: true,
+        location: config.incoming.targetSite,
       };
       window.openDialog("chrome://pippki/content/exceptionDialog.xul",
-                        "","chrome,centerscreen,modal", params);
+                        "", "chrome,centerscreen,modal", params);
       if (params.exceptionAdded) { // set by dialog
         config.incoming.badCert = false;
       } else {
         return false;
       }
     }
     if (!config.outgoing.existingServerKey) {
       if (config.outgoing.socketType > 1 && // SSL or STARTTLS
           config.outgoing.badCert) {
         var params = {
-          exceptionAdded : false,
-          prefetchCert : true,
-          location : config.outgoing.targetSite,
+          exceptionAdded: false,
+          prefetchCert: true,
+          location: config.outgoing.targetSite,
         };
         window.openDialog("chrome://pippki/content/exceptionDialog.xul",
-                          "","chrome,centerscreen,modal", params);
+                          "", "chrome,centerscreen,modal", params);
         if (params.exceptionAdded) { // set by dialog
           config.outgoing.badCert = false;
         } else {
           return false;
         }
       }
     }
     return true;
   },
-}
+};
 var gSecurityWarningDialog = new SecurityWarningDialog();
--- a/mail/components/accountcreation/content/fetchConfig.js
+++ b/mail/components/accountcreation/content/fetchConfig.js
@@ -8,20 +8,18 @@
  * application install directory's "isp" subdirectory.
  * Params @see fetchConfigFromISP()
  */
 
 ChromeUtils.import("resource:///modules/mailServices.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/JXON.js");
 
-function fetchConfigFromDisk(domain, successCallback, errorCallback)
-{
-  return new TimeoutAbortable(runAsync(function()
-  {
+function fetchConfigFromDisk(domain, successCallback, errorCallback) {
+  return new TimeoutAbortable(runAsync(function() {
     try {
       // <TB installdir>/isp/example.com.xml
       var configLocation = Services.dirsvc.get("CurProcD", Ci.nsIFile);
       configLocation.append("isp");
       configLocation.append(sanitize.hostname(domain) + ".xml");
 
       if (!configLocation.exists() || !configLocation.isReadable()) {
         errorCallback("local file not found");
@@ -52,18 +50,17 @@ function fetchConfigFromDisk(domain, suc
  * @param errorCallback {Function(ex)}   A callback that
  *         will be called when we could not retrieve a configuration,
  *         for whatever reason. This is expected (e.g. when there's no config
  *         for this domain at this location),
  *         so do not unconditionally show this to the user.
  *         The first parameter will be an exception object or error string.
  */
 function fetchConfigFromISP(domain, emailAddress, successCallback,
-                            errorCallback)
-{
+                            errorCallback) {
   if (!Services.prefs.getBoolPref(
       "mailnews.auto_config.fetchFromISP.enabled")) {
     errorCallback("ISP fetch disabled per user preference");
     return;
   }
 
   let url1 = "http://autoconfig." + sanitize.hostname(domain) +
              "/mail/config-v1.1.xml";
@@ -73,38 +70,34 @@ function fetchConfigFromISP(domain, emai
   let sucAbortable = new SuccessiveAbortable();
   var time = Date.now();
   var urlArgs = { emailaddress: emailAddress };
   if (!Services.prefs.getBoolPref(
       "mailnews.auto_config.fetchFromISP.sendEmailAddress")) {
     delete urlArgs.emailaddress;
   }
   let fetch1 = new FetchHTTP(url1, urlArgs, false,
-    function(result)
-    {
+    function(result) {
       successCallback(readFromXML(result));
     },
     function(e1) // fetch1 failed
     {
       ddump("fetchisp 1 <" + url1 + "> took " + (Date.now() - time) +
           "ms and failed with " + e1);
       time = Date.now();
-      if (e1 instanceof CancelledException)
-      {
+      if (e1 instanceof CancelledException) {
         errorCallback(e1);
         return;
       }
 
       let fetch2 = new FetchHTTP(url2, urlArgs, false,
-        function(result)
-        {
+        function(result) {
           successCallback(readFromXML(result));
         },
-        function(e2)
-        {
+        function(e2) {
           ddump("fetchisp 2 <" + url2 + "> took " + (Date.now() - time) +
               "ms and failed with " + e2);
           // return the error for the primary call,
           // unless the fetch was cancelled
           errorCallback(e2 instanceof CancelledException ? e2 : e1);
         });
       sucAbortable.current = fetch2;
       fetch2.start();
@@ -115,33 +108,31 @@ function fetchConfigFromISP(domain, emai
 }
 
 /**
  * Tries to get a configuration for this ISP from a central database at
  * Mozilla servers.
  * Params @see fetchConfigFromISP()
  */
 
-function fetchConfigFromDB(domain, successCallback, errorCallback)
-{
+function fetchConfigFromDB(domain, successCallback, errorCallback) {
   let url = Services.prefs.getCharPref("mailnews.auto_config_url");
   domain = sanitize.hostname(domain);
 
   // If we don't specify a place to put the domain, put it at the end.
   if (!url.includes("{{domain}}"))
     url = url + domain;
   else
     url = url.replace("{{domain}}", domain);
   url = url.replace("{{accounts}}", MailServices.accounts.accounts.length);
 
   if (!url.length)
     return errorCallback("no fetch url set");
   let fetch = new FetchHTTP(url, null, false,
-                            function(result)
-                            {
+                            function(result) {
                               successCallback(readFromXML(result));
                             },
                             errorCallback);
   fetch.start();
   return fetch;
 }
 
 /**
@@ -160,30 +151,28 @@ function fetchConfigFromDB(domain, succe
  *   conclusional jump we make here.) and alternative domains
  *   (e.g. yahoo.de -> yahoo.com).
  * - We make a look up for the base domain. E.g. if MX is
  *   mx1.incoming.servers.hoster.com, we look up hoster.com.
  *   Thanks to Services.eTLD, we also get bbc.co.uk right.
  *
  * Params @see fetchConfigFromISP()
  */
-function fetchConfigForMX(domain, successCallback, errorCallback)
-{
+function fetchConfigForMX(domain, successCallback, errorCallback) {
   domain = sanitize.hostname(domain);
 
   var sucAbortable = new SuccessiveAbortable();
   var time = Date.now();
   sucAbortable.current = getMX(domain,
     function(mxHostname) // success
     {
       ddump("getmx took " + (Date.now() - time) + "ms");
       let sld = Services.eTLD.getBaseDomainFromHost(mxHostname);
       ddump("base domain " + sld + " for " + mxHostname);
-      if (sld == domain)
-      {
+      if (sld == domain) {
         errorCallback("MX lookup would be no different from domain");
         return;
       }
       sucAbortable.current = fetchConfigFromDB(sld, successCallback,
                                                errorCallback);
     },
     errorCallback);
   return sucAbortable;
@@ -206,36 +195,33 @@ function fetchConfigForMX(domain, succes
  *
  * @param domain @see fetchConfigFromISP()
  * @param successCallback {function(hostname {String})
  *   Called when we found an MX for the domain.
  *   For |hostname|, see description above.
  * @param errorCallback @see fetchConfigFromISP()
  * @returns @see fetchConfigFromISP()
  */
-function getMX(domain, successCallback, errorCallback)
-{
+function getMX(domain, successCallback, errorCallback) {
   domain = sanitize.hostname(domain);
 
   let url = Services.prefs.getCharPref("mailnews.mx_service_url");
   if (!url)
     errorCallback("no URL for MX service configured");
   url += domain;
 
   let fetch = new FetchHTTP(url, null, false,
-    function(result)
-    {
+    function(result) {
       // result is plain text, with one line per server.
       // So just take the first line
       ddump("MX query result: \n" + result + "(end)");
       assert(typeof(result) == "string");
       let first = result.split("\n")[0];
       first.toLowerCase().replace(/[^a-z0-9\-_\.]*/g, "");
-      if (first.length == 0)
-      {
+      if (first.length == 0) {
         errorCallback("no MX found");
         return;
       }
       successCallback(first);
     },
     errorCallback);
   fetch.start();
   return fetch;
--- a/mail/components/accountcreation/content/fetchhttp.js
+++ b/mail/components/accountcreation/content/fetchhttp.js
@@ -64,204 +64,181 @@ ChromeUtils.import("resource:///modules/
  *   The values will be urlComponentEncoded, so pass them unencoded.
  *   This cannot be used together with |uploadBody|.
  * @param uploadbody {Object}   Arbitrary object, which to use as
  *   body of the HTTP request. Will also set the mimetype accordingly.
  *   Only supported object types, currently only E4X is supported
  *   (sending XML).
  *   Usually, you have nothing to upload, so just pass |null|.
  */
-function FetchHTTP(url, urlArgs, post, successCallback, errorCallback)
-{
+function FetchHTTP(url, urlArgs, post, successCallback, errorCallback) {
   assert(typeof(successCallback) == "function", "BUG: successCallback");
   assert(typeof(errorCallback) == "function", "BUG: errorCallback");
   this._url = sanitize.string(url);
   if (!urlArgs)
     urlArgs = {};
 
   this._urlArgs = urlArgs;
   this._post = sanitize.boolean(post);
   this._successCallback = successCallback;
   this._errorCallback = errorCallback;
 }
 FetchHTTP.prototype =
 {
   __proto__: Abortable.prototype,
-  _url : null, // URL as passed to ctor, without arguments
-  _urlArgs : null,
-  _post : null,
-  _successCallback : null,
-  _errorCallback : null,
-  _request : null, // the XMLHttpRequest object
-  result : null,
+  _url: null, // URL as passed to ctor, without arguments
+  _urlArgs: null,
+  _post: null,
+  _successCallback: null,
+  _errorCallback: null,
+  _request: null, // the XMLHttpRequest object
+  result: null,
 
-  start : function()
-  {
+  start() {
     var url = this._url;
-    for (var name in this._urlArgs)
-    {
+    for (var name in this._urlArgs) {
       url += (!url.includes("?") ? "?" : "&") +
               name + "=" + encodeURIComponent(this._urlArgs[name]);
     }
     this._request = new XMLHttpRequest();
     let request = this._request;
     request.open(this._post ? "POST" : "GET", url);
     request.channel.loadGroup = null;
     // needs bug 407190 patch v4 (or higher) - uncomment if that lands.
     // try {
     //    var channel = request.channel.QueryInterface(Ci.nsIHttpChannel2);
     //    channel.connectTimeout = 5;
     //    channel.requestTimeout = 5;
     //    } catch (e) { dump(e + "\n"); }
 
     var me = this;
-    request.onload = function() { me._response(true); }
-    request.onerror = function() { me._response(false); }
+    request.onload = function() { me._response(true); };
+    request.onerror = function() { me._response(false); };
     request.send(null);
   },
-  _response : function(success, exStored)
-  {
-    try
-    {
+  _response(success, exStored) {
+    try {
     var errorCode = null;
     var errorStr = null;
 
     if (success && this._request.status >= 200 &&
         this._request.status < 300) // HTTP level success
     {
-      try
-      {
+      try {
         // response
         var mimetype = this._request.getResponseHeader("Content-Type");
         if (!mimetype)
           mimetype = "";
         mimetype = mimetype.split(";")[0];
         if (mimetype == "text/xml" ||
             mimetype == "application/xml" ||
-            mimetype == "text/rdf")
-        {
+            mimetype == "text/rdf") {
           this.result = JXON.build(this._request.responseXML);
-        }
-        else
-        {
-          //ddump("mimetype: " + mimetype + " only supported as text");
+        } else {
+          // ddump("mimetype: " + mimetype + " only supported as text");
           this.result = this._request.responseText;
         }
-        //ddump("result:\n" + this.result);
-      }
-      catch (e)
-      {
+        // ddump("result:\n" + this.result);
+      } catch (e) {
         success = false;
         errorStr = getStringBundle(
                    "chrome://messenger/locale/accountCreationUtil.properties")
                    .GetStringFromName("bad_response_content.error");
         errorCode = -4;
       }
-    }
-    else
-    {
+    } else {
       success = false;
-      try
-      {
+      try {
         errorCode = this._request.status;
         errorStr = this._request.statusText;
       } catch (e) {
         // If we can't resolve the hostname in DNS etc., .statusText throws
         errorCode = -2;
         errorStr = getStringBundle(
                    "chrome://messenger/locale/accountCreationUtil.properties")
                    .GetStringFromName("cannot_contact_server.error");
         ddump(errorStr);
       }
     }
 
     // Callbacks
-    if (success)
-    {
+    if (success) {
       try {
         this._successCallback(this.result);
       } catch (e) {
         logException(e);
         this._error(e);
       }
-    }
-    else if (exStored)
+    } else if (exStored)
       this._error(exStored);
     else
       this._error(new ServerException(errorStr, errorCode, this._url));
 
-    if (this._finishedCallback)
-    {
+    if (this._finishedCallback) {
       try {
         this._finishedCallback(this);
       } catch (e) {
         logException(e);
         this._error(e);
       }
     }
 
     } catch (e) {
       // error in our fetchhttp._response() code
       logException(e);
       this._error(e);
     }
   },
-  _error : function(e)
-  {
+  _error(e) {
     try {
       this._errorCallback(e);
     } catch (e) {
       // error in errorCallback, too!
       logException(e);
       alertPrompt("Error in errorCallback for fetchhttp", e);
     }
   },
   /**
    * Call this between start() and finishedCallback fired.
    */
-  cancel : function(ex)
-  {
+  cancel(ex) {
     assert(!this.result, "Call already returned");
 
     this._request.abort();
 
     // Need to manually call error handler
     // <https://bugzilla.mozilla.org/show_bug.cgi?id=218236#c11>
     this._response(false, ex ? ex : new UserCancelledException());
   },
   /**
    * Allows caller or lib to be notified when the call is done.
    * This is useful to enable and disable a Cancel button in the UI,
    * which allows to cancel the network request.
    */
-  setFinishedCallback : function(finishedCallback)
-  {
+  setFinishedCallback(finishedCallback) {
     this._finishedCallback = finishedCallback;
   }
-}
+};
 
-function CancelledException(msg)
-{
+function CancelledException(msg) {
   Exception.call(this, msg);
 }
 CancelledException.prototype = Object.create(Exception.prototype);
 CancelledException.prototype.constructor = CancelledException;
 
-function UserCancelledException(msg)
-{
+function UserCancelledException(msg) {
   // The user knows they cancelled so I don't see a need
   // for a message to that effect.
   if (!msg)
     msg = "User cancelled";
   CancelledException.call(this, msg);
 }
 UserCancelledException.prototype = Object.create(CancelledException.prototype);
 UserCancelledException.prototype.constructor = UserCancelledException;
 
-function ServerException(msg, code, uri)
-{
+function ServerException(msg, code, uri) {
   Exception.call(this, msg);
   this.code = code;
   this.uri = uri;
 }
 ServerException.prototype = Object.create(Exception.prototype);
 ServerException.prototype.constructor = ServerException;
 
--- a/mail/components/accountcreation/content/guessConfig.js
+++ b/mail/components/accountcreation/content/guessConfig.js
@@ -49,18 +49,17 @@ var outgoingDone = false;
  * @param resultConfig {AccountConfig} (optional)
  *   A config which may be partially filled in. If so, it will be used as base
  *   for the guess.
  * @param which {String-enum} (optional)  "incoming", "outgoing", or "both".
  *   Default "both". Whether to guess only the incoming or outgoing server.
  * @result {Abortable} Allows you to cancel the guess
  */
 function guessConfig(domain, progressCallback, successCallback, errorCallback,
-                     resultConfig, which)
-{
+                     resultConfig, which) {
   assert(typeof(progressCallback) == "function", "need progressCallback");
   assert(typeof(successCallback) == "function", "need successCallback");
   assert(typeof(errorCallback) == "function", "need errorCallback");
 
   // Servers that we know enough that they support OAuth2 do not need guessing.
   if (resultConfig.incoming.auth == Ci.nsMsgAuthMethod.OAuth2) {
     successCallback(resultConfig);
     return null;
@@ -79,18 +78,17 @@ function guessConfig(domain, progressCal
   var incomingHostDetector = null;
   var outgoingHostDetector = null;
   var incomingEx = null; // if incoming had error, store ex here
   var outgoingEx = null; // if incoming had error, store ex here
   var incomingDone = (which == "outgoing");
   var outgoingDone = (which == "incoming");
   // If we're offline, we're going to pick the most common settings.
   // (Not the "best" settings, but common).
-  if (Services.io.offline)
-  {
+  if (Services.io.offline) {
     resultConfig.source = AccountConfig.kSourceUser;
     resultConfig.incoming.hostname = "mail." + domain;
     resultConfig.incoming.username = resultConfig.identity.emailAddress;
     resultConfig.outgoing.username = resultConfig.identity.emailAddress;
     resultConfig.incoming.type = "imap";
     resultConfig.incoming.port = 143;
     resultConfig.incoming.socketType = 3; // starttls
     resultConfig.incoming.auth = Ci.nsMsgAuthMethod.passwordCleartext;
@@ -104,187 +102,169 @@ function guessConfig(domain, progressCal
       type: "pop3",
       port: 110,
       socketType: 3,
       auth: Ci.nsMsgAuthMethod.passwordCleartext
     });
     successCallback(resultConfig);
     return null;
   }
-  var progress = function(thisTry)
-  {
+  var progress = function(thisTry) {
     progressCallback(protocolToString(thisTry.protocol), thisTry.hostname,
                      thisTry.port, sslConvertToSocketType(thisTry.ssl), false,
                      resultConfig);
   };
 
-  var updateConfig = function(config)
-  {
+  var updateConfig = function(config) {
     resultConfig = config;
   };
 
-  var errorInCallback = function(e)
-  {
+  var errorInCallback = function(e) {
     // The caller's errorCallback threw.
     // hopefully shouldn't happen for users.
     alertPrompt("Error in errorCallback for guessConfig()", e);
   };
 
-  var checkDone = function()
-  {
-    if (incomingEx)
-    {
+  var checkDone = function() {
+    if (incomingEx) {
       try {
         errorCallback(incomingEx, resultConfig);
       } catch (e) { errorInCallback(e); }
       return;
     }
-    if (outgoingEx)
-    {
+    if (outgoingEx) {
       try {
         errorCallback(outgoingEx, resultConfig);
       } catch (e) { errorInCallback(e); }
       return;
     }
-    if (incomingDone && outgoingDone)
-    {
+    if (incomingDone && outgoingDone) {
       try {
         successCallback(resultConfig);
       } catch (e) {
         try {
           errorCallback(e);
         } catch (e) { errorInCallback(e); }
       }
-      return;
+
     }
   };
 
   var logger = Log4Moz.getConfiguredLogger("mail.wizard");
-  var HostTryToAccountServer = function(thisTry, server)
-  {
+  var HostTryToAccountServer = function(thisTry, server) {
     server.type = protocolToString(thisTry.protocol);
     server.hostname = thisTry.hostname;
     server.port = thisTry.port;
     server.socketType = sslConvertToSocketType(thisTry.ssl);
     server.auth = chooseBestAuthMethod(thisTry.authMethods);
     server.authAlternatives = thisTry.authMethods;
     // TODO
     // cert is also bad when targetSite is set. (Same below for incoming.)
     // Fix SSLErrorHandler and security warning dialog in emailWizard.js.
     server.badCert = thisTry.selfSignedCert;
     server.targetSite = thisTry.targetSite;
-    logger.info("CHOOSING " + server.type + " "+ server.hostname + ":" +
+    logger.info("CHOOSING " + server.type + " " + server.hostname + ":" +
           server.port + ", auth method " + server.auth + " " +
           server.authAlternatives.join(",") + ", SSL " + server.socketType +
           (server.badCert ? " (bad cert!)" : ""));
   };
 
-  var outgoingSuccess = function(thisTry, alternativeTries)
-  {
+  var outgoingSuccess = function(thisTry, alternativeTries) {
     assert(thisTry.protocol == SMTP, "I only know SMTP for outgoing");
     // Ensure there are no previously saved outgoing errors, if we've got
     // success here.
     outgoingEx = null;
     HostTryToAccountServer(thisTry, resultConfig.outgoing);
 
-    for (let alternativeTry of alternativeTries)
-    {
+    for (let alternativeTry of alternativeTries) {
       // resultConfig.createNewOutgoing(); misses username etc., so copy
       let altServer = deepCopy(resultConfig.outgoing);
       HostTryToAccountServer(alternativeTry, altServer);
       assert(resultConfig.outgoingAlternatives);
       resultConfig.outgoingAlternatives.push(altServer);
     }
 
     progressCallback(resultConfig.outgoing.type,
         resultConfig.outgoing.hostname, resultConfig.outgoing.port,
         resultConfig.outgoing.socketType, true, resultConfig);
     outgoingDone = true;
     checkDone();
   };
 
-  var incomingSuccess = function(thisTry, alternativeTries)
-  {
+  var incomingSuccess = function(thisTry, alternativeTries) {
     // Ensure there are no previously saved incoming errors, if we've got
     // success here.
     incomingEx = null;
     HostTryToAccountServer(thisTry, resultConfig.incoming);
 
-    for (let alternativeTry of alternativeTries)
-    {
+    for (let alternativeTry of alternativeTries) {
       // resultConfig.createNewIncoming(); misses username etc., so copy
       let altServer = deepCopy(resultConfig.incoming);
       HostTryToAccountServer(alternativeTry, altServer);
       assert(resultConfig.incomingAlternatives);
       resultConfig.incomingAlternatives.push(altServer);
     }
 
     progressCallback(resultConfig.incoming.type,
         resultConfig.incoming.hostname, resultConfig.incoming.port,
         resultConfig.incoming.socketType, true, resultConfig);
     incomingDone = true;
     checkDone();
   };
 
-  var incomingError = function(ex)
-  {
+  var incomingError = function(ex) {
     incomingEx = ex;
     checkDone();
     incomingHostDetector.cancel(new CancelOthersException());
     outgoingHostDetector.cancel(new CancelOthersException());
   };
 
-  var outgoingError = function(ex)
-  {
+  var outgoingError = function(ex) {
     outgoingEx = ex;
     checkDone();
     incomingHostDetector.cancel(new CancelOthersException());
     outgoingHostDetector.cancel(new CancelOthersException());
   };
 
   incomingHostDetector = new IncomingHostDetector(progress, incomingSuccess,
                                                   incomingError);
   outgoingHostDetector = new OutgoingHostDetector(progress, outgoingSuccess,
                                                   outgoingError);
-  if (which == "incoming" || which == "both")
-  {
+  if (which == "incoming" || which == "both") {
     incomingHostDetector.start(resultConfig.incoming.hostname ?
             resultConfig.incoming.hostname : domain,
         !!resultConfig.incoming.hostname, resultConfig.incoming.type,
         resultConfig.incoming.port, resultConfig.incoming.socketType);
   }
-  if (which == "outgoing" || which == "both")
-  {
+  if (which == "outgoing" || which == "both") {
     outgoingHostDetector.start(resultConfig.outgoing.hostname ?
             resultConfig.outgoing.hostname : domain,
         !!resultConfig.outgoing.hostname, "smtp",
         resultConfig.outgoing.port, resultConfig.outgoing.socketType);
   }
 
   return new GuessAbortable(incomingHostDetector, outgoingHostDetector,
                             updateConfig);
 }
 
 function GuessAbortable(incomingHostDetector, outgoingHostDetector,
-                        updateConfig)
-{
+                        updateConfig) {
   Abortable.call(this);
   this._incomingHostDetector = incomingHostDetector;
   this._outgoingHostDetector = outgoingHostDetector;
   this._updateConfig = updateConfig;
 }
 GuessAbortable.prototype = Object.create(Abortable.prototype);
 GuessAbortable.prototype.constructor = GuessAbortable;
-GuessAbortable.prototype.cancel = function(ex)
-{
+GuessAbortable.prototype.cancel = function(ex) {
   this._incomingHostDetector.cancel(ex);
   this._outgoingHostDetector.cancel(ex);
 };
 
-//////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////
 // Implementation
 //
 // Objects, functions and constants that follow are not to be used outside
 // this file.
 
 var kNotTried = 0;
 var kOngoing = 1;
 var kFailed = 2;
@@ -293,92 +273,87 @@ var kSuccess = 3;
 /**
  * Internal object holding one server that we should try or did try.
  * Used as |thisTry|.
  *
  * Note: The consts it uses for protocol and ssl are defined towards the end
  * of this file and not the same as those used in AccountConfig (type,
  * socketType). (fix this)
  */
-function HostTry()
-{
+function HostTry() {
 }
 HostTry.prototype =
 {
   // IMAP, POP or SMTP
-  protocol : UNKNOWN,
+  protocol: UNKNOWN,
   // {String}
-  hostname : undefined,
+  hostname: undefined,
   // {Integer}
-  port : undefined,
+  port: undefined,
   // NONE, SSL or TLS
-  ssl : UNKNOWN,
+  ssl: UNKNOWN,
   // {String} what to send to server
-  commands : null,
+  commands: null,
   // {Integer-enum} kNotTried, kOngoing, kFailed or kSuccess
-  status : kNotTried,
+  status: kNotTried,
   // {Abortable} allows to cancel the socket comm
-  abortable : null,
+  abortable: null,
 
   // {Array of {Integer-enum}} @see _advertisesAuthMethods() result
   // Info about the server, from the protocol and SSL chat
-  authMethods : null,
+  authMethods: null,
   // {String} Whether the SSL cert is not from a proper CA
-  selfSignedCert : false,
+  selfSignedCert: false,
   // {String} Which host the SSL cert is made for, if not hostname.
   // If set, this is an SSL error.
-  targetSite : null,
+  targetSite: null,
 };
 
 /**
  * When the success or errorCallbacks are called to abort the other requests
  * which happened in parallel, this ex is used as param for cancel(), so that
  * the cancel doesn't trigger another callback.
  */
-function CancelOthersException()
-{
+function CancelOthersException() {
   CancelledException.call(this, "we're done, cancelling the other probes");
 }
 CancelOthersException.prototype = Object.create(CancelledException.prototype);
 CancelOthersException.prototype.constructor = CancelOthersException;
 
 /**
  * @param successCallback {function(result {HostTry}, alts {Array of HostTry})}
  *    Called when the config is OK
  *    |result| is the most preferred server.
  *    |alts| currently exists only for |IncomingHostDetector| and contains
  *    some servers of the other type (POP3 instead of IMAP), if available.
  * @param errorCallback {function(ex)} Called when we could not find a config
  * @param progressCallback { function(server {HostTry}) } Called when we tried
  *    (will try?) a new hostname and port
  */
-function HostDetector(progressCallback, successCallback, errorCallback)
-{
+function HostDetector(progressCallback, successCallback, errorCallback) {
   this.mSuccessCallback = successCallback;
   this.mProgressCallback = progressCallback;
   this.mErrorCallback = errorCallback;
   this._cancel = false;
   // {Array of {HostTry}}, ordered by decreasing preference
   this._hostsToTry = new Array();
 
   // init logging
   this._log = Log4Moz.getConfiguredLogger("mail.wizard");
   this._log.info("created host detector");
 }
 
 HostDetector.prototype =
 {
-  cancel : function(ex)
-  {
+  cancel(ex) {
     this._cancel = true;
     // We have to actively stop the network calls, as they may result in
     // callbacks e.g. to the cert handler. If the dialog is gone by the time
     // this happens, the javascript stack is horked.
-    for (let i = 0; i < this._hostsToTry.length; i++)
-    {
+    for (let i = 0; i < this._hostsToTry.length; i++) {
       let thisTry = this._hostsToTry[i]; // {HostTry}
       if (thisTry.abortable)
         thisTry.abortable.cancel(ex);
       thisTry.status = kFailed; // or don't set? Maybe we want to continue.
     }
     if (ex instanceof CancelOthersException)
       return;
     if (!ex)
@@ -395,23 +370,22 @@ HostDetector.prototype =
    * @param hostIsPrecise {Boolean} (default false)  use only this hostname,
    *     do not guess hostnames.
    * @param type {String-enum}@see AccountConfig type
    *     (Optional. default, 0, undefined, null = guess it)
    * @param port {Integer} (Optional. default, 0, undefined, null = guess it)
    * @param socketType {Integer-enum}@see AccountConfig socketType
    *     (Optional. default, 0, undefined, null = guess it)
    */
-  start : function(domain, hostIsPrecise, type, port, socketType)
-  {
+  start(domain, hostIsPrecise, type, port, socketType) {
     domain = domain.replace(/\s*/g, ""); // Remove whitespace
     if (!hostIsPrecise)
       hostIsPrecise = false;
     var protocol = sanitize.translate(type,
-        { "imap" : IMAP, "pop3" : POP, "smtp" : SMTP }, UNKNOWN);
+        { "imap": IMAP, "pop3": POP, "smtp": SMTP }, UNKNOWN);
     if (!port)
       port = UNKNOWN;
     var ssl = ConvertSocketTypeToSSL(socketType);
     this._cancel = false;
     this._log.info("doing auto detect for protocol " + protocol +
         ", domain " + domain + ", (exactly: " + hostIsPrecise +
         "), port " + port + ", ssl " + ssl);
 
@@ -420,49 +394,45 @@ HostDetector.prototype =
     var hostnamesToTry = [];
     // if hostIsPrecise is true, it's because that's what the user input
     // explicitly, and we'll just try it, nothing else.
     if (hostIsPrecise)
       hostnamesToTry.push(domain);
     else
       hostnamesToTry = this._hostnamesToTry(protocol, domain);
 
-    for (let i = 0; i < hostnamesToTry.length; i++)
-    {
+    for (let i = 0; i < hostnamesToTry.length; i++) {
       let hostname = hostnamesToTry[i];
       let hostEntries = this._portsToTry(hostname, protocol, ssl, port);
-      for (let j = 0; j < hostEntries.length; j++)
-      {
+      for (let j = 0; j < hostEntries.length; j++) {
         let hostTry = hostEntries[j]; // from getHostEntry()
         hostTry.hostname = hostname;
         hostTry.status = kNotTried;
         this._hostsToTry.push(hostTry);
       }
     }
 
     this._hostsToTry = sortTriesByPreference(this._hostsToTry);
     this._tryAll();
   },
 
   // We make all host/port combinations run in parallel, store their
   // results in an array, and as soon as one finishes successfully and all
   // higher-priority ones have failed, we abort all lower-priority ones.
 
-  _tryAll : function()
-  {
+  _tryAll() {
     if (this._cancel)
       return;
     var me = this;
-    for (let i = 0; i < this._hostsToTry.length; i++)
-    {
+    for (let i = 0; i < this._hostsToTry.length; i++) {
       let thisTry = this._hostsToTry[i]; // {HostTry}
       if (thisTry.status != kNotTried)
         continue;
       this._log.info("poking at " + thisTry.hostname + " port " +
-          thisTry.port + " ssl "+ thisTry.ssl + " protocol " +
+          thisTry.port + " ssl " + thisTry.ssl + " protocol " +
           protocolToString(thisTry.protocol));
       if (i == 0) // showing 50 servers at once is pointless
         this.mProgressCallback(thisTry);
 
       thisTry.abortable = SocketUtil(
           thisTry.hostname, thisTry.port, thisTry.ssl,
           thisTry.commands, TIMEOUT,
           new SSLErrorHandler(thisTry, this._log),
@@ -486,50 +456,44 @@ HostDetector.prototype =
     }
   },
 
   /**
    * @param thisTry {HostTry}
    * @param wiredata {Array of {String}} what the server returned
    *     in response to our protocol chat
    */
-  _processResult : function(thisTry, wiredata)
-  {
-    if (thisTry._gotCertError)
-    {
-      if (thisTry._gotCertError == Ci.nsICertOverrideService.ERROR_MISMATCH)
-      {
+  _processResult(thisTry, wiredata) {
+    if (thisTry._gotCertError) {
+      if (thisTry._gotCertError == Ci.nsICertOverrideService.ERROR_MISMATCH) {
         thisTry._gotCertError = 0;
         thisTry.status = kFailed;
         return;
       }
 
       if (thisTry._gotCertError == Ci.nsICertOverrideService.ERROR_UNTRUSTED ||
-          thisTry._gotCertError == Ci.nsICertOverrideService.ERROR_TIME)
-      {
+          thisTry._gotCertError == Ci.nsICertOverrideService.ERROR_TIME) {
         this._log.info("TRYING AGAIN, hopefully with exception recorded");
         thisTry._gotCertError = 0;
         thisTry.selfSignedCert = true; // _next_ run gets this exception
         thisTry.status = kNotTried; // try again (with exception)
         this._tryAll();
         return;
       }
     }
 
-    if (wiredata == null || wiredata === undefined)
-    {
+    if (wiredata == null || wiredata === undefined) {
       this._log.info("no data");
       thisTry.status = kFailed;
       return;
     }
     this._log.info("wiredata: " + wiredata.join(""));
     thisTry.authMethods =
         this._advertisesAuthMethods(thisTry.protocol, wiredata);
-    if (thisTry.ssl == TLS && !this._hasTLS(thisTry, wiredata))
-    {
+    if (thisTry.ssl == TLS && !this._hasTLS(thisTry, wiredata)) {
       this._log.info("STARTTLS wanted, but not offered");
       thisTry.status = kFailed;
       return;
     }
     this._log.info("success with " + thisTry.hostname + ":" +
         thisTry.port + " " + protocolToString(thisTry.protocol) +
         " ssl " + thisTry.ssl +
         (thisTry.selfSignedCert ? " (selfSignedCert)" : ""));
@@ -542,50 +506,42 @@ HostDetector.prototype =
       // isn't covered by that temporariness.
       this._log.info("clearing validity override for " + thisTry.hostname);
       Cc["@mozilla.org/security/certoverride;1"]
         .getService(Ci.nsICertOverrideService)
         .clearValidityOverride(thisTry.hostname, thisTry.port);
     }
   },
 
-  _checkFinished : function()
-  {
+  _checkFinished() {
     var successfulTry = null;
     var successfulTryAlternative = null; // POP3
     var unfinishedBusiness = false;
     // this._hostsToTry is ordered by decreasing preference
-    for (let i = 0; i < this._hostsToTry.length; i++)
-    {
+    for (let i = 0; i < this._hostsToTry.length; i++) {
       let thisTry = this._hostsToTry[i];
       if (thisTry.status == kNotTried || thisTry.status == kOngoing)
         unfinishedBusiness = true;
       // thisTry is good, and all higher preference tries failed, so use this
-      else if (thisTry.status == kSuccess && !unfinishedBusiness)
-      {
-        if (!successfulTry)
-        {
+      else if (thisTry.status == kSuccess && !unfinishedBusiness) {
+        if (!successfulTry) {
           successfulTry = thisTry;
           if (successfulTry.protocol == SMTP)
             break;
-        }
-        else if (successfulTry.protocol != thisTry.protocol)
-        {
+        } else if (successfulTry.protocol != thisTry.protocol) {
           successfulTryAlternative = thisTry;
           break;
         }
       }
     }
-    if (successfulTry && (successfulTryAlternative || !unfinishedBusiness))
-    {
+    if (successfulTry && (successfulTryAlternative || !unfinishedBusiness)) {
       this.mSuccessCallback(successfulTry,
           successfulTryAlternative ? [ successfulTryAlternative ] : []);
       this.cancel(new CancelOthersException());
-    }
-    else if (!unfinishedBusiness) // all failed
+    } else if (!unfinishedBusiness) // all failed
     {
       this._log.info("ran out of options");
       var errorMsg = getStringBundle(
           "chrome://messenger/locale/accountCreationModel.properties")
           .GetStringFromName("cannot_find_server.error");
       this.mErrorCallback(new Exception(errorMsg));
       // no need to cancel, all failed
     }
@@ -600,18 +556,17 @@ HostDetector.prototype =
    * @param protocol {Integer-enum} IMAP, POP or SMTP
    * @param capaResponse {Array of {String}} on the wire data
    *     that the server returned. May be the full exchange or just capa.
    * @returns {Array of {Integer-enum} values for AccountConfig.incoming.auth
    *     (or outgoing), in decreasing order of preference.
    *     E.g. [ 5, 4 ] for a server that supports only Kerberos and
    *     encrypted passwords.
    */
-  _advertisesAuthMethods : function(protocol, capaResponse)
-  {
+  _advertisesAuthMethods(protocol, capaResponse) {
     // for imap, capabilities include e.g.:
     // "AUTH=CRAM-MD5", "AUTH=NTLM", "AUTH=GSSAPI", "AUTH=MSN"
     // for pop3, the auth mechanisms are returned in capa as the following:
     // "CRAM-MD5", "NTLM", "MSN", "GSSAPI"
     // For smtp, EHLO will return AUTH and then a list of the
     // mechanism(s) supported, e.g.,
     // AUTH LOGIN NTLM MSN CRAM-MD5 GSSAPI
     var result = new Array();
@@ -632,216 +587,201 @@ HostDetector.prototype =
       result.push(Ci.nsMsgAuthMethod.passwordEncrypted);
     if (new RegExp(prefix + "(NTLM|MSN)").test(line))
       result.push(Ci.nsMsgAuthMethod.NTLM);
     if (protocol != IMAP || !line.includes("LOGINDISABLED"))
       result.push(Ci.nsMsgAuthMethod.passwordCleartext);
     return result;
   },
 
-  _hasTLS : function(thisTry, wiredata)
-  {
+  _hasTLS(thisTry, wiredata) {
     var capa = thisTry.protocol == POP ? "STLS" : "STARTTLS";
     return thisTry.ssl == TLS &&
         wiredata.join("").toUpperCase().includes(capa);
   },
-}
+};
 
 /**
  * @param authMethods @see return value of _advertisesAuthMethods()
  *    Note: the returned auth method will be removed from the array.
  * @return one of them, the preferred one
  * Note: this might be Kerberos, which might not actually work,
  * so you might need to try the others, too.
  */
-function chooseBestAuthMethod(authMethods)
-{
+function chooseBestAuthMethod(authMethods) {
   if (!authMethods || !authMethods.length)
     return Ci.nsMsgAuthMethod.passwordCleartext;
   return authMethods.shift(); // take first (= most preferred)
 }
 
 
 function IncomingHostDetector(
-  progressCallback, successCallback, errorCallback)
-{
+  progressCallback, successCallback, errorCallback) {
   HostDetector.call(this, progressCallback, successCallback, errorCallback);
 }
 IncomingHostDetector.prototype =
 {
   __proto__: HostDetector.prototype,
-  _hostnamesToTry : function(protocol, domain)
-  {
+  _hostnamesToTry(protocol, domain) {
     var hostnamesToTry = [];
     if (protocol != POP)
-      hostnamesToTry.push("imap." +  domain);
-    if (protocol != IMAP)
-    {
-      hostnamesToTry.push("pop3." +  domain);
-      hostnamesToTry.push("pop." +  domain);
+      hostnamesToTry.push("imap." + domain);
+    if (protocol != IMAP) {
+      hostnamesToTry.push("pop3." + domain);
+      hostnamesToTry.push("pop." + domain);
     }
     hostnamesToTry.push("mail." + domain);
     hostnamesToTry.push(domain);
     return hostnamesToTry;
   },
-  _portsToTry : getIncomingTryOrder,
-}
+  _portsToTry: getIncomingTryOrder,
+};
 
 function OutgoingHostDetector(
-  progressCallback, successCallback, errorCallback)
-{
+  progressCallback, successCallback, errorCallback) {
   HostDetector.call(this, progressCallback, successCallback, errorCallback);
 }
 OutgoingHostDetector.prototype =
 {
   __proto__: HostDetector.prototype,
-  _hostnamesToTry : function(protocol, domain)
-  {
+  _hostnamesToTry(protocol, domain) {
     var hostnamesToTry = [];
     hostnamesToTry.push("smtp." + domain);
     hostnamesToTry.push("mail." + domain);
     hostnamesToTry.push(domain);
     return hostnamesToTry;
   },
-  _portsToTry : getOutgoingTryOrder,
-}
+  _portsToTry: getOutgoingTryOrder,
+};
 
-//////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////
 // Encode protocol ports and order of preference
 
 // Protocol Types
 var UNKNOWN = -1;
 var IMAP = 0;
 var POP = 1;
 var SMTP = 2;
 // Security Types
 var NONE = 0; // no encryption
-//1 would be "TLS if available"
+// 1 would be "TLS if available"
 var TLS = 2; // STARTTLS
 var SSL = 3; // SSL / TLS
 
-var IMAP_PORTS = {}
+var IMAP_PORTS = {};
 IMAP_PORTS[NONE] = 143;
 IMAP_PORTS[TLS] = 143;
 IMAP_PORTS[SSL] = 993;
 
-var POP_PORTS = {}
+var POP_PORTS = {};
 POP_PORTS[NONE] = 110;
 POP_PORTS[TLS] = 110;
 POP_PORTS[SSL] = 995;
 
-var SMTP_PORTS = {}
+var SMTP_PORTS = {};
 SMTP_PORTS[NONE] = 587;
 SMTP_PORTS[TLS] = 587;
 SMTP_PORTS[SSL] = 465;
 
-var CMDS = {}
+var CMDS = {};
 CMDS[IMAP] = ["1 CAPABILITY\r\n", "2 LOGOUT\r\n"];
 CMDS[POP] = ["CAPA\r\n", "QUIT\r\n"];
 CMDS[SMTP] = ["EHLO we-guess.mozilla.org\r\n", "QUIT\r\n"];
 
 /**
  * Sort by preference of SSL, IMAP etc.
  * @param tries {Array of {HostTry}}
  * @returns {Array of {HostTry}}
  */
-function sortTriesByPreference(tries)
-{
-  return tries.sort(function __sortByPreference(a, b)
-  {
+function sortTriesByPreference(tries) {
+  return tries.sort(function __sortByPreference(a, b) {
     // -1 = a is better; 1 = b is better; 0 = equal
     // Prefer SSL/TLS above all else
     if (a.ssl != NONE && b.ssl == NONE)
       return -1;
     if (b.ssl != NONE && a.ssl == NONE)
       return 1;
     // Prefer IMAP over POP
     if (a.protocol == IMAP && b.protocol == POP)
       return -1;
     if (b.protocol == IMAP && a.protocol == POP)
       return 1;
     // For hostnames, leave existing sorting, as in _hostnamesToTry()
     // For ports, leave existing sorting, as in getOutgoingTryOrder()
     return 0;
   });
-};
+}
 
 // TODO prefer SSL over STARTTLS,
 // either in sortTriesByPreference or in getIncomingTryOrder() (and outgoing)
 
 /**
  * @returns {Array of {HostTry}}
  */
-function getIncomingTryOrder(host, protocol, ssl, port)
-{
+function getIncomingTryOrder(host, protocol, ssl, port) {
   var lowerCaseHost = host.toLowerCase();
 
   if (protocol == UNKNOWN &&
       (lowerCaseHost.startsWith("pop.") || lowerCaseHost.startsWith("pop3.")))
     protocol = POP;
   else if (protocol == UNKNOWN && lowerCaseHost.startsWith("imap."))
     protocol = IMAP;
 
   if (protocol != UNKNOWN) {
     if (ssl == UNKNOWN)
       return [getHostEntry(protocol, TLS, port),
-              //getHostEntry(protocol, SSL, port),
+              // getHostEntry(protocol, SSL, port),
               getHostEntry(protocol, NONE, port)];
     return [getHostEntry(protocol, ssl, port)];
   }
   if (ssl == UNKNOWN)
     return [getHostEntry(IMAP, TLS, port),
-            //getHostEntry(IMAP, SSL, port),
+            // getHostEntry(IMAP, SSL, port),
             getHostEntry(POP, TLS, port),
-            //getHostEntry(POP, SSL, port),
+            // getHostEntry(POP, SSL, port),
             getHostEntry(IMAP, NONE, port),
             getHostEntry(POP, NONE, port)];
   return [getHostEntry(IMAP, ssl, port),
           getHostEntry(POP, ssl, port)];
-};
+}
 
 /**
  * @returns {Array of {HostTry}}
  */
-function getOutgoingTryOrder(host, protocol, ssl, port)
-{
+function getOutgoingTryOrder(host, protocol, ssl, port) {
   assert(protocol == SMTP, "need SMTP as protocol for outgoing");
-  if (ssl == UNKNOWN)
-  {
+  if (ssl == UNKNOWN) {
     if (port == UNKNOWN)
       // neither SSL nor port known
       return [getHostEntry(SMTP, TLS, UNKNOWN),
               getHostEntry(SMTP, TLS, 25),
-              //getHostEntry(SMTP, SSL, UNKNOWN),
+              // getHostEntry(SMTP, SSL, UNKNOWN),
               getHostEntry(SMTP, NONE, UNKNOWN),
               getHostEntry(SMTP, NONE, 25)];
     // port known, SSL not
     return [getHostEntry(SMTP, TLS, port),
-            //getHostEntry(SMTP, SSL, port),
+            // getHostEntry(SMTP, SSL, port),
             getHostEntry(SMTP, NONE, port)];
   }
   // SSL known, port not
-  if (port == UNKNOWN)
-  {
+  if (port == UNKNOWN) {
     if (ssl == SSL)
       return [getHostEntry(SMTP, SSL, UNKNOWN)];
-    else // TLS or NONE
-      return [getHostEntry(SMTP, ssl, UNKNOWN),
+    return [getHostEntry(SMTP, ssl, UNKNOWN),
               getHostEntry(SMTP, ssl, 25)];
   }
   // SSL and port known
   return [getHostEntry(SMTP, ssl, port)];
-};
+}
 
 /**
  * @returns {HostTry} with proper default port and commands,
  *     but without hostname.
  */
-function getHostEntry(protocol, ssl, port)
-{
+function getHostEntry(protocol, ssl, port) {
   if (!port || port == UNKNOWN) {
     switch (protocol) {
       case POP:
         port = POP_PORTS[ssl];
         break;
       case IMAP:
         port = IMAP_PORTS[ssl];
         break;
@@ -854,82 +794,77 @@ function getHostEntry(protocol, ssl, por
   }
 
   var r = new HostTry();
   r.protocol = protocol;
   r.ssl = ssl;
   r.port = port;
   r.commands = CMDS[protocol];
   return r;
-};
+}
 
 
 // Convert consts from those used here to those from AccountConfig
 // TODO adjust consts to match AccountConfig
 
 // here -> AccountConfig
-function sslConvertToSocketType(ssl)
-{
+function sslConvertToSocketType(ssl) {
   if (ssl == NONE)
     return 1;
   if (ssl == SSL)
     return 2;
   if (ssl == TLS)
     return 3;
   throw new NotReached("unexpected SSL type");
 }
 
 // AccountConfig -> here
-function ConvertSocketTypeToSSL(socketType)
-{
+function ConvertSocketTypeToSSL(socketType) {
   if (socketType == 1)
     return NONE;
   if (socketType == 2)
     return SSL;
   if (socketType == 3)
     return TLS;
   return UNKNOWN;
 }
 
 // here -> AccountConfig
-function protocolToString(type)
-{
+function protocolToString(type) {
   if (type == IMAP)
     return "imap";
   if (type == POP)
     return "pop3";
   if (type == SMTP)
     return "smtp";
   throw new NotReached("unexpected protocol");
 }
 
 
 
-/////////////////////////////////////////////////////////
+// ///////////////////////////////////////////////////////
 // SSL cert error handler
 
 /**
  * Called by MyBadCertHandler.js, which called by PSM
  * to tell us about SSL certificate errors.
  * @param thisTry {HostTry}
  * @param logger {Log4Moz logger}
  */
-function SSLErrorHandler(thisTry, logger)
-{
+function SSLErrorHandler(thisTry, logger) {
   this._try = thisTry;
   this._log = logger;
   // _ gotCertError will be set to an error code (one of those defined in
   // nsICertOverrideService)
   this._gotCertError = 0;
 }
 SSLErrorHandler.prototype =
 {
-  processCertError : function(socketInfo, status, targetSite)
-  {
-    this._log.error("Got Cert error for "+ targetSite);
+  processCertError(socketInfo, status, targetSite) {
+    this._log.error("Got Cert error for " + targetSite);
 
     if (!status)
       return true;
 
     let cert = status.QueryInterface(Ci.nsISSLStatus).serverCert;
     let flags = 0;
 
     let parts = targetSite.split(":");
@@ -960,26 +895,23 @@ SSLErrorHandler.prototype =
      * What makes it dangerous is that we (!) propose the server to the user,
      * and he cannot judge whether imap.gmailservers.com is correct or not,
      * and he will likely approve it.
      */
 
     if (status.isDomainMismatch) {
       this._try._gotCertError = Ci.nsICertOverrideService.ERROR_MISMATCH;
       flags |= Ci.nsICertOverrideService.ERROR_MISMATCH;
-    }
-    else if (status.isUntrusted) { // e.g. self-signed
+    } else if (status.isUntrusted) { // e.g. self-signed
       this._try._gotCertError = Ci.nsICertOverrideService.ERROR_UNTRUSTED;
       flags |= Ci.nsICertOverrideService.ERROR_UNTRUSTED;
-    }
-    else if (status.isNotValidAtThisTime) {
+    } else if (status.isNotValidAtThisTime) {
       this._try._gotCertError = Ci.nsICertOverrideService.ERROR_TIME;
       flags |= Ci.nsICertOverrideService.ERROR_TIME;
-    }
-    else {
+    } else {
       this._try._gotCertError = -1; // other
     }
 
     /* We will add a temporary cert exception here, so that
      * we can continue and connect and try.
      * But we will remove it again as soon as we close the
      * connection, in _processResult().
      * _gotCertError will serve as the marker that we
@@ -994,21 +926,21 @@ SSLErrorHandler.prototype =
     Cc["@mozilla.org/security/certoverride;1"]
       .getService(Ci.nsICertOverrideService)
       .rememberValidityOverride(host, port, cert, flags,
         true); // temporary override
     this._log.warn("!! Overrode bad cert temporarily " + host + " " + port +
                    " flags=" + flags + "\n");
     return true;
   },
-}
+};
 
 
 
-//////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////
 // Socket Util
 
 
 /**
  * @param hostname {String} The DNS hostname to connect to.
  * @param port {Integer} The numberic port to connect to on the host.
  * @param ssl {Integer} SSL, TLS or NONE
  * @param commands {Array of String}: protocol commands
@@ -1016,34 +948,31 @@ SSLErrorHandler.prototype =
  * @param timeout {Integer} seconds to wait for a server response, then cancel.
  * @param sslErrorHandler {SSLErrorHandler}
  * @param resultCallback {function(wiredata)} This function will
  *            be called with the result string array from the server
  *            or null if no communication occurred.
  * @param errorCallback {function(e)}
  */
 function SocketUtil(hostname, port, ssl, commands, timeout,
-                    sslErrorHandler, resultCallback, errorCallback)
-{
+                    sslErrorHandler, resultCallback, errorCallback) {
   assert(commands && commands.length, "need commands");
 
   var index = 0; // commands[index] is next to send to server
   var initialized = false;
   var aborted = false;
 
-  function _error(e)
-  {
+  function _error(e) {
     if (aborted)
       return;
     aborted = true;
     errorCallback(e);
   }
 
-  function timeoutFunc()
-  {
+  function timeoutFunc() {
     if (!initialized)
       _error("timeout");
   }
 
   // In case DNS takes too long or does not resolve or another blocking
   // issue occurs before the timeout can be set on the socket, this
   // ensures that the listener callback will be fired in a timely manner.
   // XXX There might to be some clean up needed after the timeout is fired
@@ -1071,46 +1000,40 @@ function SocketUtil(hostname, port, ssl,
   var outstream = transport.openOutputStream(0, 0, 0);
   var stream = transport.openInputStream(0, 0, 0);
   var instream = Cc["@mozilla.org/scriptableinputstream;1"]
       .createInstance(Ci.nsIScriptableInputStream);
   instream.init(stream);
 
   var dataListener =
   {
-    data : new Array(),
-    onStartRequest: function(request, context)
-    {
+    data: new Array(),
+    onStartRequest(request, context) {
       try {
         initialized = true;
-        if (!aborted)
-        {
+        if (!aborted) {
           // Send the first request
           let outputData = commands[index++];
           outstream.write(outputData, outputData.length);
         }
       } catch (e) { _error(e); }
     },
-    onStopRequest: function(request, context, status)
-    {
+    onStopRequest(request, context, status) {
       try {
         instream.close();
         outstream.close();
         resultCallback(this.data.length ? this.data : null);
       } catch (e) { _error(e); }
     },
-    onDataAvailable: function(request, context, inputStream, offset, count)
-    {
+    onDataAvailable(request, context, inputStream, offset, count) {
       try {
-        if (!aborted)
-        {
+        if (!aborted) {
           let inputData = instream.read(count);
           this.data.push(inputData);
-          if (index < commands.length)
-          {
+          if (index < commands.length) {
             // Send the next request to the server.
             let outputData = commands[index++];
             outstream.write(outputData, outputData.length);
           }
         }
       } catch (e) { _error(e); }
     }
   };
@@ -1121,25 +1044,23 @@ function SocketUtil(hostname, port, ssl,
 
     pump.init(stream, 0, 0, false);
     pump.asyncRead(dataListener, null);
     return new SocketAbortable(transport);
   } catch (e) { _error(e); }
   return null;
 }
 
-function SocketAbortable(transport)
-{
+function SocketAbortable(transport) {
   Abortable.call(this);
   assert(transport instanceof Ci.nsITransport, "need transport");
   this._transport = transport;
 }
 SocketAbortable.prototype = Object.create(Abortable.prototype);
 SocketAbortable.prototype.constructor = UserCancelledException;
-SocketAbortable.prototype.cancel = function(ex)
-{
+SocketAbortable.prototype.cancel = function(ex) {
   try {
     this._transport.close(Cr.NS_ERROR_ABORT);
   } catch (e) {
     ddump("canceling socket failed: " + e);
   }
-}
+};
 
--- a/mail/components/accountcreation/content/readFromXML.js
+++ b/mail/components/accountcreation/content/readFromXML.js
@@ -14,43 +14,40 @@
  * The XML format is documented at
  * <https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat>
  *
  * @param clientConfigXML {JXON}  The <clientConfig> node.
  * @return AccountConfig   object filled with the data from XML
  */
 ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
 
-function readFromXML(clientConfigXML)
-{
+function readFromXML(clientConfigXML) {
   function array_or_undef(value) {
     return value === undefined ? [] : value;
   }
   var exception;
   if (typeof(clientConfigXML) != "object" ||
       !("clientConfig" in clientConfigXML) ||
-      !("emailProvider" in clientConfigXML.clientConfig))
-  {
+      !("emailProvider" in clientConfigXML.clientConfig)) {
     dump("client config xml = " + JSON.stringify(clientConfigXML) + "\n");
     var stringBundle = getStringBundle(
         "chrome://messenger/locale/accountCreationModel.properties");
     throw stringBundle.GetStringFromName("no_emailProvider.error");
   }
   var xml = clientConfigXML.clientConfig.emailProvider;
 
   var d = new AccountConfig();
   d.source = AccountConfig.kSourceXML;
 
   d.id = sanitize.hostname(xml["@id"]);
   d.displayName = d.id;
   try {
     d.displayName = sanitize.label(xml.displayName);
   } catch (e) { logException(e); }
-  for (var domain of xml.$domain)
-  {
+  for (var domain of xml.$domain) {
     try {
       d.domains.push(sanitize.hostname(domain));
     } catch (e) { logException(e); exception = e; }
   }
   if (d.domains.length == 0)
     throw exception ? exception : "need proper <domain> in XML";
   exception = null;
 
@@ -66,51 +63,48 @@ function readFromXML(clientConfigXML)
       // We need a username even for Kerberos, need it even internally.
       iO.username = sanitize.string(iX.username); // may be a %VARIABLE%
 
       if ("password" in iX) {
         d.rememberPassword = true;
         iO.password = sanitize.string(iX.password);
       }
 
-      for (let iXsocketType of array_or_undef(iX.$socketType))
-      {
+      for (let iXsocketType of array_or_undef(iX.$socketType)) {
         try {
           iO.socketType = sanitize.translate(iXsocketType,
-              { plain : 1, SSL: 2, STARTTLS: 3 });
+              { plain: 1, SSL: 2, STARTTLS: 3 });
           break; // take first that we support
         } catch (e) { exception = e; }
       }
       if (!iO.socketType)
         throw exception ? exception : "need proper <socketType> in XML";
       exception = null;
 
-      for (let iXauth of array_or_undef(iX.$authentication))
-      {
+      for (let iXauth of array_or_undef(iX.$authentication)) {
         try {
           iO.auth = sanitize.translate(iXauth,
-              { "password-cleartext" : Ci.nsMsgAuthMethod.passwordCleartext,
+              { "password-cleartext": Ci.nsMsgAuthMethod.passwordCleartext,
                 // @deprecated TODO remove
-                "plain" : Ci.nsMsgAuthMethod.passwordCleartext,
-                "password-encrypted" : Ci.nsMsgAuthMethod.passwordEncrypted,
+                "plain": Ci.nsMsgAuthMethod.passwordCleartext,
+                "password-encrypted": Ci.nsMsgAuthMethod.passwordEncrypted,
                 // @deprecated TODO remove
-                "secure" : Ci.nsMsgAuthMethod.passwordEncrypted,
-                "GSSAPI" : Ci.nsMsgAuthMethod.GSSAPI,
-                "NTLM" : Ci.nsMsgAuthMethod.NTLM,
-                "OAuth2" : Ci.nsMsgAuthMethod.OAuth2 });
+                "secure": Ci.nsMsgAuthMethod.passwordEncrypted,
+                "GSSAPI": Ci.nsMsgAuthMethod.GSSAPI,
+                "NTLM": Ci.nsMsgAuthMethod.NTLM,
+                "OAuth2": Ci.nsMsgAuthMethod.OAuth2 });
           break; // take first that we support
         } catch (e) { exception = e; }
       }
       if (!iO.auth)
         throw exception ? exception : "need proper <authentication> in XML";
       exception = null;
 
       // defaults are in accountConfig.js
-      if (iO.type == "pop3" && "pop3" in iX)
-      {
+      if (iO.type == "pop3" && "pop3" in iX) {
         try {
           if ("leaveMessagesOnServer" in iX.pop3)
             iO.leaveMessagesOnServer =
                 sanitize.boolean(iX.pop3.leaveMessagesOnServer);
           if ("daysToLeaveMessagesOnServer" in iX.pop3)
             iO.daysToLeaveMessagesOnServer =
                 sanitize.integer(iX.pop3.daysToLeaveMessagesOnServer);
         } catch (e) { logException(e); }
@@ -132,56 +126,53 @@ function readFromXML(clientConfigXML)
     throw exception ? exception : "Need proper <incomingServer> in XML file";
   exception = null;
 
   // outgoing server
   for (let oX of array_or_undef(xml.$outgoingServer)) // input (XML)
   {
     let oO = d.createNewOutgoing(); // output (object)
     try {
-      if (oX["@type"] != "smtp")
-      {
+      if (oX["@type"] != "smtp") {
         var stringBundle = getStringBundle(
             "chrome://messenger/locale/accountCreationModel.properties");
         throw stringBundle.GetStringFromName("outgoing_not_smtp.error");
       }
       oO.hostname = sanitize.hostname(oX.hostname);
       oO.port = sanitize.integerRange(oX.port, kMinPort, kMaxPort);
 
-      for (let oXsocketType of array_or_undef(oX.$socketType))
-      {
+      for (let oXsocketType of array_or_undef(oX.$socketType)) {
         try {
           oO.socketType = sanitize.translate(oXsocketType,
-              { plain : 1, SSL: 2, STARTTLS: 3 });
+              { plain: 1, SSL: 2, STARTTLS: 3 });
           break; // take first that we support
         } catch (e) { exception = e; }
       }
       if (!oO.socketType)
         throw exception ? exception : "need proper <socketType> in XML";
       exception = null;
 
-      for (let oXauth of array_or_undef(oX.$authentication))
-      {
+      for (let oXauth of array_or_undef(oX.$authentication)) {
         try {
           oO.auth = sanitize.translate(oXauth,
               { // open relay
-                "none" : Ci.nsMsgAuthMethod.none,
+                "none": Ci.nsMsgAuthMethod.none,
                 // inside ISP or corp network
-                "client-IP-address" : Ci.nsMsgAuthMethod.none,
+                "client-IP-address": Ci.nsMsgAuthMethod.none,
                 // hope for the best
-                "smtp-after-pop" : Ci.nsMsgAuthMethod.none,
-                "password-cleartext" : Ci.nsMsgAuthMethod.passwordCleartext,
+                "smtp-after-pop": Ci.nsMsgAuthMethod.none,
+                "password-cleartext": Ci.nsMsgAuthMethod.passwordCleartext,
                 // @deprecated TODO remove
-                "plain" : Ci.nsMsgAuthMethod.passwordCleartext,
-                "password-encrypted" : Ci.nsMsgAuthMethod.passwordEncrypted,
+                "plain": Ci.nsMsgAuthMethod.passwordCleartext,
+                "password-encrypted": Ci.nsMsgAuthMethod.passwordEncrypted,
                 // @deprecated TODO remove
-                "secure" : Ci.nsMsgAuthMethod.passwordEncrypted,
-                "GSSAPI" : Ci.nsMsgAuthMethod.GSSAPI,
-                "NTLM" : Ci.nsMsgAuthMethod.NTLM,
-                "OAuth2" : Ci.nsMsgAuthMethod.OAuth2,
+                "secure": Ci.nsMsgAuthMethod.passwordEncrypted,
+                "GSSAPI": Ci.nsMsgAuthMethod.GSSAPI,
+                "NTLM": Ci.nsMsgAuthMethod.NTLM,
+                "OAuth2": Ci.nsMsgAuthMethod.OAuth2,
               });
 
           break; // take first that we support
         } catch (e) { exception = e; }
       }
       if (!oO.auth)
         throw exception ? exception : "need proper <authentication> in XML";
       exception = null;
@@ -215,24 +206,23 @@ function readFromXML(clientConfigXML)
     } catch (e) { logException(e); exception = e; }
   }
   if (!d.outgoing.hostname)
     // throw exception for last server
     throw exception ? exception : "Need proper <outgoingServer> in XML file";
   exception = null;
 
   d.inputFields = new Array();
-  for (let inputField of array_or_undef(xml.$inputField))
-  {
+  for (let inputField of array_or_undef(xml.$inputField)) {
     try {
       var fieldset =
       {
-        varname : sanitize.alphanumdash(inputField["@key"]).toUpperCase(),
-        displayName : sanitize.label(inputField["@label"]),
-        exampleValue : sanitize.label(inputField.value)
+        varname: sanitize.alphanumdash(inputField["@key"]).toUpperCase(),
+        displayName: sanitize.label(inputField["@label"]),
+        exampleValue: sanitize.label(inputField.value)
       };
       d.inputFields.push(fieldset);
     } catch (e) { logException(e); } // for now, don't throw,
         // because we don't support custom fields yet anyways.
   }
 
   return d;
 }
--- a/mail/components/accountcreation/content/sanitizeDatatypes.js
+++ b/mail/components/accountcreation/content/sanitizeDatatypes.js
@@ -15,89 +15,82 @@
  * the expected datatype in JS types. If the value is not as expected,
  * they throw exceptions.
  */
 
 ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
 
 var sanitize =
 {
-  integer : function(unchecked)
-  {
+  integer(unchecked) {
     if (typeof(unchecked) == "number" && !isNaN(unchecked))
       return unchecked;
 
     var r = parseInt(unchecked);
     if (isNaN(r))
       throw new MalformedException("no_number.error", unchecked);
 
     return r;
   },
 
-  integerRange : function(unchecked, min, max)
-  {
+  integerRange(unchecked, min, max) {
     var int = this.integer(unchecked);
     if (int < min)
       throw new MalformedException("number_too_small.error", unchecked);
 
     if (int > max)
       throw new MalformedException("number_too_large.error", unchecked);
 
     return int;
   },
 
-  boolean : function(unchecked)
-  {
+  boolean(unchecked) {
     if (typeof(unchecked) == "boolean")
       return unchecked;
 
     if (unchecked == "true")
       return true;
 
     if (unchecked == "false")
       return false;
 
     throw new MalformedException("boolean.error", unchecked);
   },
 
-  string : function(unchecked)
-  {
+  string(unchecked) {
     return String(unchecked);
   },
 
-  nonemptystring : function(unchecked)
-  {
+  nonemptystring(unchecked) {
     if (!unchecked)
       throw new MalformedException("string_empty.error", unchecked);
 
     return this.string(unchecked);
   },
 
   /**
    * Allow only letters, numbers, "-" and "_".
    *
    * Empty strings not allowed (good idea?).
    */
-  alphanumdash : function(unchecked)
-  {
+  alphanumdash(unchecked) {
     var str = this.nonemptystring(unchecked);
     if (!/^[a-zA-Z0-9\-\_]*$/.test(str))
       throw new MalformedException("alphanumdash.error", unchecked);
 
     return str;
   },
 
   /**
    * DNS hostnames like foo.bar.example.com
    * Allow only letters, numbers, "-" and "."
    * Empty strings not allowed.
    * Currently does not support IDN (international domain names).
    */
-  hostname : function(unchecked)
-  {
+  hostname(unchecked) {
     let str = cleanUpHostName(this.nonemptystring(unchecked));
 
     // Allow placeholders. TODO move to a new hostnameOrPlaceholder()
     // The regex is "anything, followed by one or more (placeholders than
     // anything)".  This doesn't catch the non-placeholder case, but that's
     // handled down below.
     if (/^[a-zA-Z0-9\-\.]*(%[A-Z0-9]+%[a-zA-Z0-9\-\.]*)+$/.test(str))
       return str;
@@ -105,18 +98,17 @@ var sanitize =
     if (!isLegalHostNameOrIP(str))
       throw new MalformedException("hostname_syntax.error", unchecked);
 
     return str.toLowerCase();
   },
   /**
    * A non-chrome URL that's safe to request.
    */
-  url : function (unchecked)
-  {
+  url(unchecked) {
     var str =  this.string(unchecked);
     if (!str.startsWith("http") && !str.startsWith("https"))
       throw new MalformedException("url_scheme.error", unchecked);
 
     var uri;
     try {
       uri = Services.io.newURI(str);
       uri = uri.QueryInterface(Ci.nsIURL);
@@ -128,36 +120,33 @@ var sanitize =
       throw new MalformedException("url_scheme.error", unchecked);
 
     return uri.spec;
   },
 
   /**
    * A value which should be shown to the user in the UI as label
    */
-  label : function(unchecked)
-  {
+  label(unchecked) {
     return this.string(unchecked);
   },
 
   /**
    * Allows only certain values as input, otherwise throw.
    *
    * @param unchecked {Any} The value to check
    * @param allowedValues {Array} List of values that |unchecked| may have.
    * @param defaultValue {Any} (Optional) If |unchecked| does not match
    *       anything in |mapping|, a |defaultValue| can be returned instead of
    *       throwing an exception. The latter is the default and happens when
    *       no |defaultValue| is passed.
    * @throws MalformedException
    */
-  enum : function(unchecked, allowedValues, defaultValue)
-  {
-    for (let allowedValue of allowedValues)
-    {
+  enum(unchecked, allowedValues, defaultValue) {
+    for (let allowedValue of allowedValues) {
       if (allowedValue == unchecked)
         return allowedValue;
     }
     // value is bad
     if (typeof(defaultValue) == "undefined")
       throw new MalformedException("allowed_value.error", unchecked);
     return defaultValue;
   },
@@ -174,32 +163,29 @@ var sanitize =
    *       would be: { foo: 1, bar : 2 }.
    *       Use quotes when you need freaky characters: "baz-" : 3.
    * @param defaultValue {Any} (Optional) If |unchecked| does not match
    *       anything in |mapping|, a |defaultValue| can be returned instead of
    *       throwing an exception. The latter is the default and happens when
    *       no |defaultValue| is passed.
    * @throws MalformedException
    */
-  translate : function(unchecked, mapping, defaultValue)
-  {
-    for (var inputValue in mapping)
-    {
+  translate(unchecked, mapping, defaultValue) {
+    for (var inputValue in mapping) {
       if (inputValue == unchecked)
         return mapping[inputValue];
     }
     // value is bad
     if (typeof(defaultValue) == "undefined")
       throw new MalformedException("allowed_value.error", unchecked);
     return defaultValue;
   }
 };
 
-function MalformedException(msgID, uncheckedBadValue)
-{
+function MalformedException(msgID, uncheckedBadValue) {
   var stringBundle = getStringBundle(
       "chrome://messenger/locale/accountCreationUtil.properties");
   var msg = stringBundle.GetStringFromName(msgID);
   if (kDebug)
     msg += " (bad value: " + new String(uncheckedBadValue) + ")";
   Exception.call(this, msg);
 }
 MalformedException.prototype = Object.create(Exception.prototype);
--- a/mail/components/accountcreation/content/util.js
+++ b/mail/components/accountcreation/content/util.js
@@ -4,60 +4,55 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 /**
  * Some common, generic functions
  */
 
 ChromeUtils.import("resource:///modules/errUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-function assert(test, errorMsg)
-{
+function assert(test, errorMsg) {
   if (!test)
     throw new NotReached(errorMsg ? errorMsg :
           "Programming bug. Assertion failed, see log.");
 }
 
-function makeCallback(obj, func)
-{
+function makeCallback(obj, func) {
   return func.bind(obj);
 }
 
 
 /**
  * Runs the given function sometime later
  *
  * Currently implemented using setTimeout(), but
  * can later be replaced with an nsITimer impl,
  * when code wants to use it in a module.
  */
-function runAsync(func)
-{
+function runAsync(func) {
   setTimeout(func, 0);
 }
 
 
 /**
  * @param uriStr {String}
  * @result {nsIURI}
  */
-function makeNSIURI(uriStr)
-{
+function makeNSIURI(uriStr) {
   return Services.io.newURI(uriStr);
 }
 
 
 /**
  * Reads UTF8 data from a URL.
  *
  * @param uri {nsIURI}   what you want to read
  * @return {Array of String}   the contents of the file, one string per line
  */
-function readURLasUTF8(uri)
-{
+function readURLasUTF8(uri) {
   assert(uri instanceof Ci.nsIURI, "uri must be an nsIURI");
   try {
     let chan = Services.io.newChannelFromURI2(uri,
                                               null,
                                               Services.scriptSecurityManager.getSystemPrincipal(),
                                               null,
                                               Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                               Ci.nsIContentPolicy.TYPE_OTHER);
@@ -90,204 +85,184 @@ function readURLasUTF8(uri)
  * it into lines, and returns an array with one string per line
  *
  * Linebreaks are not contained in the result,,
  * and all of \r\n, (Windows) \r (Mac) and \n (Unix) counts as linebreak.
  *
  * @param content {String} one long string with the whole file
  * @return {Array of String} one string per line (no linebreaks)
  */
-function splitLines(content)
-{
+function splitLines(content) {
   content = content.replace("\r\n", "\n");
   content = content.replace("\r", "\n");
   return content.split("\n");
 }
 
 /**
  * @param bundleURI {String}   chrome URL to properties file
  * @return nsIStringBundle
  */
-function getStringBundle(bundleURI)
-{
+function getStringBundle(bundleURI) {
   try {
     return Services.strings.createBundle(bundleURI);
   } catch (e) {
     throw new Exception("Failed to get stringbundle URI <" + bundleURI +
                         ">. Error: " + e);
   }
 }
 
 
-function Exception(msg)
-{
+function Exception(msg) {
   this._message = msg;
 
   // get stack
   try {
     not.found.here += 1; // force a native exception ...
   } catch (e) {
     this.stack = e.stack; // ... to get the current stack
   }
 }
 Exception.prototype =
 {
-  get message()
-  {
+  get message() {
     return this._message;
   },
-  toString : function()
-  {
+  toString() {
     return this._message;
   }
-}
+};
 
-function NotReached(msg)
-{
+function NotReached(msg) {
   Exception.call(this, msg); // call super constructor
   logException(this);
 }
 // Make NotReached extend Exception.
 NotReached.prototype = Object.create(Exception.prototype);
 NotReached.prototype.constructor = NotReached;
 
 /**
  * A handle for an async function which you can cancel.
  * The async function will return an object of this type (a subtype)
  * and you can call cancel() when you feel like killing the function.
  */
-function Abortable()
-{
+function Abortable() {
 }
 Abortable.prototype =
 {
-  cancel : function()
-  {
+  cancel() {
   }
-}
+};
 
 /**
  * Utility implementation, for allowing to abort a setTimeout.
  * Use like: return new TimeoutAbortable(setTimeout(function(){ ... }, 0));
  * @param setTimeoutID {Integer}  Return value of setTimeout()
  */
-function TimeoutAbortable(setTimeoutID)
-{
+function TimeoutAbortable(setTimeoutID) {
   Abortable.call(this, setTimeoutID); // call super constructor
   this._id = setTimeoutID;
 }
 TimeoutAbortable.prototype = Object.create(Abortable.prototype);
 TimeoutAbortable.prototype.constructor = TimeoutAbortable;
-TimeoutAbortable.prototype.cancel = function() { clearTimeout(this._id); }
+TimeoutAbortable.prototype.cancel = function() { clearTimeout(this._id); };
 
 /**
  * Utility implementation, for allowing to abort a setTimeout.
  * Use like: return new TimeoutAbortable(setTimeout(function(){ ... }, 0));
  * @param setIntervalID {Integer}  Return value of setInterval()
  */
-function IntervalAbortable(setIntervalID)
-{
+function IntervalAbortable(setIntervalID) {
   Abortable.call(this, setIntervalID); // call super constructor
   this._id = setIntervalID;
 }
 IntervalAbortable.prototype = Object.create(Abortable.prototype);
 IntervalAbortable.prototype.constructor = IntervalAbortable;
-IntervalAbortable.prototype.cancel = function() { clearInterval(this._id); }
+IntervalAbortable.prototype.cancel = function() { clearInterval(this._id); };
 
 // Allows you to make several network calls, but return
 // only one Abortable object.
-function SuccessiveAbortable()
-{
+function SuccessiveAbortable() {
   Abortable.call(this); // call super constructor
   this._current = null;
 }
 SuccessiveAbortable.prototype = {
   __proto__: Abortable.prototype,
   get current() { return this._current; },
-  set current(abortable)
-  {
+  set current(abortable) {
     assert(abortable instanceof Abortable || abortable == null,
         "need an Abortable object (or null)");
     this._current = abortable;
   },
-  cancel: function()
-  {
+  cancel() {
     if (this._current)
       this._current.cancel();
   }
-}
+};
 
-function deepCopy(org)
-{
+function deepCopy(org) {
   if (typeof(org) == "undefined")
     return undefined;
   if (org == null)
     return null;
   if (typeof(org) == "string")
     return org;
   if (typeof(org) == "number")
     return org;
   if (typeof(org) == "boolean")
     return org == true;
   if (typeof(org) == "function")
     return org;
   if (typeof(org) != "object")
     throw "can't copy objects of type " + typeof(org) + " yet";
 
-  //TODO still instanceof org != instanceof copy
-  //var result = new org.constructor();
+  // TODO still instanceof org != instanceof copy
+  // var result = new org.constructor();
   var result = new Object();
   if (typeof(org.length) != "undefined")
     var result = new Array();
   for (var prop in org)
     result[prop] = deepCopy(org[prop]);
   return result;
 }
 
 if (typeof gEmailWizardLogger == "undefined") {
   ChromeUtils.import("resource:///modules/gloda/log4moz.js");
   var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.wizard");
 }
-function ddump(text)
-{
+function ddump(text) {
   gEmailWizardLogger.info(text);
 }
 
-function debugObject(obj, name, maxDepth, curDepth)
-{
+function debugObject(obj, name, maxDepth, curDepth) {
   if (curDepth == undefined)
     curDepth = 0;
   if (maxDepth != undefined && curDepth > maxDepth)
     return "";
 
   var result = "";
   var i = 0;
-  for (let prop in obj)
-  {
+  for (let prop in obj) {
     i++;
     try {
-      if (typeof(obj[prop]) == "object")
-      {
+      if (typeof(obj[prop]) == "object") {
         if (obj[prop] && obj[prop].length != undefined)
           result += name + "." + prop + "=[probably array, length " +
                 obj[prop].length + "]\n";
         else
           result += name + "." + prop + "=[" + typeof(obj[prop]) + "]\n";
         result += debugObject(obj[prop], name + "." + prop,
                               maxDepth, curDepth + 1);
-      }
-      else if (typeof(obj[prop]) == "function")
+      } else if (typeof(obj[prop]) == "function")
         result += name + "." + prop + "=[function]\n";
       else
         result += name + "." + prop + "=" + obj[prop] + "\n";
     } catch (e) {
       result += name + "." + prop + "-> Exception(" + e + ")\n";
     }
   }
   if (!i)
     result += name + " is empty\n";
   return result;
 }
 
-function alertPrompt(alertTitle, alertMsg)
-{
+function alertPrompt(alertTitle, alertMsg) {
   Services.prompt.alert(window, alertTitle, alertMsg);
 }
--- a/mail/components/accountcreation/content/verifyConfig.js
+++ b/mail/components/accountcreation/content/verifyConfig.js
@@ -32,18 +32,17 @@
 ChromeUtils.import("resource:///modules/mailServices.js");
 ChromeUtils.import("resource:///modules/OAuth2Providers.jsm");
 
 if (typeof gEmailWizardLogger == "undefined") {
   ChromeUtils.import("resource:///modules/gloda/log4moz.js");
   var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.wizard");
 }
 
-function verifyConfig(config, alter, msgWindow, successCallback, errorCallback)
-{
+function verifyConfig(config, alter, msgWindow, successCallback, errorCallback) {
   ddump(debugObject(config, "config", 3));
   assert(config instanceof AccountConfig,
          "BUG: Arg 'config' needs to be an AccountConfig object");
   assert(typeof(alter) == "boolean");
   assert(typeof(successCallback) == "function");
   assert(typeof(errorCallback) == "function");
 
   if (MailServices.accounts.findRealServer(config.incoming.username,
@@ -103,131 +102,118 @@ function verifyConfig(config, alter, msg
       verifyLogon(config, inServer, alter, msgWindow,
                   successCallback, errorCallback);
     else {
       // Avoid pref pollution, clear out server prefs.
       MailServices.accounts.removeIncomingServer(inServer, true);
       successCallback(config);
     }
     return;
-  }
-  catch (e) {
+  } catch (e) {
     gEmailWizardLogger.error("ERROR: verify logon shouldn't have failed");
   }
   // Avoid pref pollution, clear out server prefs.
   MailServices.accounts.removeIncomingServer(inServer, true);
   errorCallback(e);
 }
 
 function verifyLogon(config, inServer, alter, msgWindow, successCallback,
-                     errorCallback)
-{
+                     errorCallback) {
   gEmailWizardLogger.info("verifyLogon for server at " + inServer.hostName);
   // hack - save away the old callbacks.
   let saveCallbacks = msgWindow.notificationCallbacks;
   // set our own callbacks - this works because verifyLogon will
   // synchronously create the transport and use the notification callbacks.
   let listener = new urlListener(config, inServer, alter, msgWindow,
                                  successCallback, errorCallback);
   // our listener listens both for the url and cert errors.
   msgWindow.notificationCallbacks = listener;
   // try to work around bug where backend is clearing password.
   try {
     inServer.password = config.incoming.password;
     let uri = inServer.verifyLogon(listener, msgWindow);
     // clear msgWindow so url won't prompt for passwords.
     uri.QueryInterface(Ci.nsIMsgMailNewsUrl).msgWindow = null;
-  }
-  catch (e) { gEmailWizardLogger.error("verifyLogon failed: " + e); throw e;}
-  finally {
+  } catch (e) { gEmailWizardLogger.error("verifyLogon failed: " + e); throw e; } finally {
     // restore them
     msgWindow.notificationCallbacks = saveCallbacks;
   }
 }
 
 /**
  * The url listener also implements nsIBadCertListener2.  Its job is to prevent
  * "bad cert" security dialogs from being shown to the user.  Currently it puts
  * up the cert override dialog, though we'd like to give the user more detailed
  * information in the future.
  */
 
 function urlListener(config, server, alter, msgWindow, successCallback,
-                     errorCallback)
-{
+                     errorCallback) {
   this.mConfig = config;
   this.mServer = server;
   this.mAlter = alter;
   this.mSuccessCallback = successCallback;
   this.mErrorCallback = errorCallback;
   this.mMsgWindow = msgWindow;
   this.mCertError = false;
   this._log = Log4Moz.getConfiguredLogger("mail.wizard");
 }
 urlListener.prototype =
 {
-  OnStartRunningUrl: function(aUrl)
-  {
+  OnStartRunningUrl(aUrl) {
     this._log.info("Starting to test username");
     this._log.info("  username=" + (this.mConfig.incoming.username !=
                           this.mConfig.identity.emailAddress) +
                           ", have savedUsername=" +
                           (this.mConfig.usernameSaved ? "true" : "false"));
     this._log.info("  authMethod=" + this.mServer.authMethod);
   },
 
-  OnStopRunningUrl: function(aUrl, aExitCode)
-  {
+  OnStopRunningUrl(aUrl, aExitCode) {
     this._log.info("Finished verifyConfig resulted in " + aExitCode);
-    if (Components.isSuccessCode(aExitCode))
-    {
+    if (Components.isSuccessCode(aExitCode)) {
       this._cleanup();
       this.mSuccessCallback(this.mConfig);
     }
     // Logon failed, and we aren't supposed to try other variations.
-    else if (!this.mAlter)
-    {
+    else if (!this.mAlter) {
       this._cleanup();
       var errorMsg = getStringBundle(
           "chrome://messenger/locale/accountCreationModel.properties")
           .GetStringFromName("cannot_login.error");
       this.mErrorCallback(new Exception(errorMsg));
     }
     // Try other variations, unless there's a cert error, in which
     // case we'll see what the user chooses.
-    else if (!this.mCertError)
-    {
-      this.tryNextLogon()
+    else if (!this.mCertError) {
+      this.tryNextLogon();
     }
   },
 
-  tryNextLogon: function()
-  {
+  tryNextLogon() {
     this._log.info("tryNextLogon()");
     this._log.info("  username=" + (this.mConfig.incoming.username !=
                           this.mConfig.identity.emailAddress) +
                           ", have savedUsername=" +
                           (this.mConfig.usernameSaved ? "true" : "false"));
     this._log.info("  authMethod=" + this.mServer.authMethod);
     // check if we tried full email address as username
-    if (this.mConfig.incoming.username != this.mConfig.identity.emailAddress)
-    {
+    if (this.mConfig.incoming.username != this.mConfig.identity.emailAddress) {
       this._log.info("  Changing username to email address.");
       this.mConfig.usernameSaved = this.mConfig.incoming.username;
       this.mConfig.incoming.username = this.mConfig.identity.emailAddress;
       this.mConfig.outgoing.username = this.mConfig.identity.emailAddress;
       this.mServer.username = this.mConfig.incoming.username;
       this.mServer.password = this.mConfig.incoming.password;
       verifyLogon(this.mConfig, this.mServer, this.mAlter, this.mMsgWindow,
                   this.mSuccessCallback, this.mErrorCallback);
       return;
     }
 
-    if (this.mConfig.usernameSaved)
-    {
+    if (this.mConfig.usernameSaved) {
       this._log.info("  Re-setting username.");
       // If we tried the full email address as the username, then let's go
       // back to trying just the username before trying the other cases.
       this.mConfig.incoming.username = this.mConfig.usernameSaved;
       this.mConfig.outgoing.username = this.mConfig.usernameSaved;
       this.mConfig.usernameSaved = null;
       this.mServer.username = this.mConfig.incoming.username;
       this.mServer.password = this.mConfig.incoming.password;
@@ -272,70 +258,68 @@ urlListener.prototype =
 
     // Tried all variations we can. Give up.
     this._log.info("Giving up.");
     this._cleanup();
     let errorMsg = getStringBundle(
         "chrome://messenger/locale/accountCreationModel.properties")
         .GetStringFromName("cannot_login.error");
     this.mErrorCallback(new Exception(errorMsg));
-    return;
+
   },
 
-  _cleanup : function()
-  {
+  _cleanup() {
     try {
       // Avoid pref pollution, clear out server prefs.
       if (this.mServer) {
         MailServices.accounts.removeIncomingServer(this.mServer, true);
         this.mServer = null;
       }
     } catch (e) { this._log.error(e); }
   },
 
   // Suppress any certificate errors
-  notifyCertProblem: function(socketInfo, status, targetSite) {
+  notifyCertProblem(socketInfo, status, targetSite) {
     this.mCertError = true;
     this._log.error("cert error");
     let self = this;
-    setTimeout(function () {
+    setTimeout(function() {
       try {
         self.informUserOfCertError(socketInfo, status, targetSite);
-      } catch (e)  { logException(e); }
+      } catch (e) { logException(e); }
     }, 0);
     return true;
   },
 
-  informUserOfCertError : function(socketInfo, status, targetSite) {
+  informUserOfCertError(socketInfo, status, targetSite) {
     var params = {
-      exceptionAdded : false,
-      sslStatus : status,
-      prefetchCert : true,
-      location : targetSite,
+      exceptionAdded: false,
+      sslStatus: status,
+      prefetchCert: true,
+      location: targetSite,
     };
     window.openDialog("chrome://pippki/content/exceptionDialog.xul",
-                      "","chrome,centerscreen,modal", params);
+                      "", "chrome,centerscreen,modal", params);
     this._log.info("cert exception dialog closed");
     this._log.info("cert exceptionAdded = " + params.exceptionAdded);
     if (!params.exceptionAdded) {
       this._cleanup();
       let errorMsg = getStringBundle(
           "chrome://messenger/locale/accountCreationModel.properties")
           .GetStringFromName("cannot_login.error");
       this.mErrorCallback(new Exception(errorMsg));
-    }
-    else {
+    } else {
       // Retry the logon now that we've added the cert exception.
       verifyLogon(this.mConfig, this.mServer, this.mAlter, this.mMsgWindow,
                   this.mSuccessCallback, this.mErrorCallback);
     }
   },
 
   // nsIInterfaceRequestor
-  getInterface: function(iid) {
+  getInterface(iid) {
     return this.QueryInterface(iid);
   },
 
   // nsISupports
   QueryInterface: ChromeUtils.generateQI(["nsIBadCertListener2",
                                           "nsIInterfaceRequestor",
                                           "nsIUrlListener"]),
-}
+};