diff --git a/mailnews/base/prefs/resources/content/AccountWizard.js b/mailnews/base/prefs/resources/content/AccountWizard.js
index e880cd6505a2..a0a5c0b2bd63 100644
--- a/mailnews/base/prefs/resources/content/AccountWizard.js
+++ b/mailnews/base/prefs/resources/content/AccountWizard.js
@@ -206,6 +206,16 @@ function FinishAccount() {
if (!serverIsNntp(pageData))
EnableCheckMailAtStartUpIfNeeded(gCurrentAccount);
+ if (!document.getElementById("downloadMsgs").hidden) {
+ if (document.getElementById("downloadMsgs").checked) {
+ window.opener.gNewAccountToLoad = gCurrentAccount; // load messages for new POP account
+ }
+ else if (gCurrentAccount == am.defaultAccount) {
+ // stop check for msgs when this is first account created from new profile
+ window.opener.gLoadStartFolder = false;
+ }
+ }
+
// in case we crash, force us a save of the prefs file NOW
try {
am.saveAccountInfo();
@@ -225,7 +235,6 @@ function FinishAccount() {
}
}
-
// prepopulate pageData with stuff from accountData
// use: to prepopulate the wizard with account information
function AccountDataToPageData(accountData, pageData)
diff --git a/mailnews/base/prefs/resources/content/AccountWizard.xul b/mailnews/base/prefs/resources/content/AccountWizard.xul
index 67b2962dfd4f..7c89082dd649 100644
--- a/mailnews/base/prefs/resources/content/AccountWizard.xul
+++ b/mailnews/base/prefs/resources/content/AccountWizard.xul
@@ -256,6 +256,10 @@ Rights Reserved.
+
+
+
+
&clickFinish.label;
diff --git a/mailnews/base/prefs/resources/content/accountUtils.js b/mailnews/base/prefs/resources/content/accountUtils.js
index 4c4022640d4e..962d8c402e72 100644
--- a/mailnews/base/prefs/resources/content/accountUtils.js
+++ b/mailnews/base/prefs/resources/content/accountUtils.js
@@ -208,6 +208,8 @@ function msgOpenAccountWizard()
window.openDialog("chrome://messenger/content/AccountWizard.xul",
"AccountWizard", "chrome,modal,titlebar,resizable");
+ loadInboxForNewAccount();
+
//For the first account we need to reset the default smtp server in the panel.
var smtpService = Components.classes["@mozilla.org/messengercompose/smtp;1"].getService(Components.interfaces.nsISmtpService);
var serverCount = smtpService.smtpServers.Count();
@@ -231,3 +233,19 @@ function MsgAccountManager(selectPage)
"AccountManager", "chrome,modal,titlebar,resizable",
{ server: server, selectPage: selectPage });
}
+
+function loadInboxForNewAccount() {
+ // gNewAccountToLoad is set in the final screen of the Account Wizard if a POP account
+ // was created, the download messages box is checked, and the wizard was opened from the 3pane
+ if (gNewAccountToLoad) {
+ var rootMsgFolder = gNewAccountToLoad.incomingServer.rootMsgFolder;
+ var outNumFolders = new Object();
+ var inboxFolder = rootMsgFolder.getFoldersWithFlag(0x1000, 1, outNumFolders);
+ var selectedFolderResource = inboxFolder.QueryInterface(Components.interfaces.nsIRDFResource);
+ var selectedFolder = selectedFolderResource.QueryInterface(Components.interfaces.nsIFolder);
+ SelectFolder(selectedFolder.URI);
+ window.focus();
+ setTimeout(MsgGetMessage, 0);
+ gNewAccountToLoad = null;
+ }
+}
diff --git a/mailnews/base/prefs/resources/content/aw-server.js b/mailnews/base/prefs/resources/content/aw-server.js
index 7092deee6555..19411b763215 100644
--- a/mailnews/base/prefs/resources/content/aw-server.js
+++ b/mailnews/base/prefs/resources/content/aw-server.js
@@ -124,6 +124,7 @@ function serverPageInit() {
// Set pop3 server type as default selection
var pop3RadioItem = document.getElementById("pop3");
serverTypeRadioGroup.selectedItem = pop3RadioItem;
+ setServerType();
}
}
@@ -187,4 +188,14 @@ function setServerType()
var pageData = parent.GetPageData();
var serverType = (document.getElementById("servertype")).selectedItem.value;
setPageData(pageData, "server", "servertype", serverType);
+
+ var ioService = Components.classes["@mozilla.org/network/io-service;1"]
+ .getService(Components.interfaces.nsIIOService);
+
+ // only show checkbox if (1) mail window is opener (2) this is a pop account and (3) we are online
+ var openedFromMail = (window.opener.location.href == "chrome://messenger/content/messenger.xul") ||
+ (window.opener.location.href == "chrome://messenger/content/mail3PaneWindowVertLayout.xul");
+
+ document.getElementById("downloadMsgs").hidden = (openedFromMail && serverType == "pop3" && !ioService.offline) ? false : true;
+
}
diff --git a/mailnews/base/resources/content/msgMail3PaneWindow.js b/mailnews/base/resources/content/msgMail3PaneWindow.js
index 85336db9768d..104b6dbc85b2 100644
--- a/mailnews/base/resources/content/msgMail3PaneWindow.js
+++ b/mailnews/base/resources/content/msgMail3PaneWindow.js
@@ -60,6 +60,8 @@ var gRightMouseButtonDown = false;
// This is used to make sure that the row with the currentIndex has the selection
// after a Delete or Move of a message that has a row index less than currentIndex.
var gThreadPaneCurrentSelectedIndex = -1;
+var gLoadStartFolder = true;
+var gNewAccountToLoad = null;
// Global var to keep track of if the 'Delete Message' or 'Move To' thread pane
// context menu item was triggered. This helps prevent the tree view from
@@ -777,14 +779,15 @@ function loadStartFolder(initialUri)
var startFolder = startFolderResource.QueryInterface(Components.interfaces.nsIFolder);
SelectFolder(startFolder.URI);
-
+
// only do this on startup, when we pass in null
- if (!initialUri && isLoginAtStartUpEnabled)
+ if (!initialUri && isLoginAtStartUpEnabled && gLoadStartFolder)
{
// Perform biff on the server to check for new mail, except for imap
if (defaultServer.type != "imap")
defaultServer.PerformBiff();
- }
+ }
+
// because the "open" state persists, we'll call
// PerformExpand() for all servers that are open at startup.