Bug 490985 - "[autoconfig] Unable to find the incoming server after changing from IMAP to POP3" [r=philringnalda sr=bienvenu]
authorBlake Winton <bwinton@latte.ca>
Tue, 01 Sep 2009 16:44:03 +0100
changeset 3474 e2d7771ba879fcf38159df92c473223ba242bb2a
parent 3473 12460d9e985bc2862d146513a2dee99813d137fc
child 3475 9c1a3c3eaa80d09b41eb76e8b885dc5f4b36edc2
push idunknown
push userunknown
push dateunknown
reviewersphilringnalda, bienvenu
bugs490985
Bug 490985 - "[autoconfig] Unable to find the incoming server after changing from IMAP to POP3" [r=philringnalda sr=bienvenu]
mailnews/base/prefs/content/accountcreation/emailWizard.js
mailnews/base/prefs/content/accountcreation/emailWizard.xul
--- a/mailnews/base/prefs/content/accountcreation/emailWizard.js
+++ b/mailnews/base/prefs/content/accountcreation/emailWizard.js
@@ -92,20 +92,22 @@ EmailConfigWizard.prototype =
   _init : function EmailConfigWizard__init()
   {
     gEmailWizardLogger.info("Initializing setup wizard");
     this._probeAbortable = null;
   },
 
   onLoad : function()
   {
+    this._domain = "";
     this._email = "";
     this._realname = "";
     this._password = "";
     this._verifiedConfig = false;
+    this._userChangedIncomingServer = false;
     this._userChangedIncomingProtocol = false;
     this._userChangedIncomingPort = false;
     this._userChangedIncomingSocketType = false;
     this._userChangedOutgoingPort = false;
     this._userChangedOutgoingSocketType = false;
     this._userChangedPassword = false;
 
     this._incomingWarning = 'cleartext';
@@ -154,18 +156,18 @@ EmailConfigWizard.prototype =
     this._accountInfoInputs(true);
 
     this._email = document.getElementById("email").value;
     this._realname = document.getElementById("realname").value;
     this._password = document.getElementById("password").value;
 
     this.showConfigDetails();
 
-    let domain = this._email.split("@")[1];
-    this.findConfig(domain, this._email);
+    this._domain = this._email.split("@")[1];
+    this.findConfig(this._domain, this._email);
 
     // swap out buttons
     _hide("next_button");
     _show("back_button");
     _show("stop_button");
     _hide("edit_button");
     _hide("go_button");
   },
@@ -327,16 +329,22 @@ EmailConfigWizard.prototype =
         break;
       case 'outgoing_security':
         this._userChangedOutgoingSocketType = true;
         this._outgoingState = "";
         break;
     }
   },
 
+  setIncomingServer : function()
+  {
+    this._userChangedIncomingServer = true;
+    this._incomingState = "";
+  },
+
   setIncomingProtocol : function()
   {
     this._userChangedIncomingProtocol = true;
     this._incomingState = "";
   },
 
   setPort : function(eltId)
   {
@@ -1269,27 +1277,33 @@ EmailConfigWizard.prototype =
     config.incoming._inprogress = true;
     // User entered hostname, we may want to probe port and protocol and socketType
     if (!this._userChangedIncomingProtocol)
       config.incoming.protocol = undefined;
     if (!this._userChangedIncomingPort)
       config.incoming.port = undefined;
     if (!this._userChangedIncomingSocketType)
       config.incoming.socketType = undefined;
+    if (!this._userChangedIncomingServer) {
+      config.incoming.hostname = undefined;
+    }
 
     if (this._probeAbortable)
     {
       gEmailWizardLogger.info("restarting probe: " + config.incoming.hostname);
       this._probeAbortable.restart(config.incoming.hostname, config, "incoming",
                                    config.incoming.protocol, config.incoming.port,
                                    config.incoming.socketType);
     }
     else
     {
-      this._guessConfig(config.incoming.hostname, config, "incoming");
+      let domain = this._domain;
+      if (config.incoming.hostname)
+        domain = config.incoming.hostname;
+      this._guessConfig(domain, config, "incoming");
     }
   },
 
   _startProbingOutgoing : function(config)
   {
     gEmailWizardLogger.info("_startProbingOutgoing: " + config.outgoing.hostname +
                             " probe = " + this._probeAbortable);
     this.startSpinner("searching_for_configs");
--- a/mailnews/base/prefs/content/accountcreation/emailWizard.xul
+++ b/mailnews/base/prefs/content/accountcreation/emailWizard.xul
@@ -270,16 +270,17 @@
                   <label class="textbox-label" value="&receivingServer.label;"
                           control="incoming_server"/>
                   <hbox>
                     <vbox id="incoming_status" class="icon" width="22"/>
                     <hbox>
                       <textbox id="incoming_server"
                                value=""
                                disabled="true"
+                               oninput="gEmailConfigWizard.setIncomingServer()"
                                class="host uri-element"/>
                     </hbox>
                   </hbox>
                   <hbox>
                     <spacer height="30" width="22"/>
                     <hbox>
                       <menulist id="incoming_protocol"
                                 value=""