From c19cc750644abc1bf72316ed44ced511f9be9da9 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Thu, 2 Mar 2000 23:42:32 +0000 Subject: [PATCH] second part of fix for #29714 - tie a particular SMTP server to a particular identity if the ISP requests it. r=mscott a=phil git-svn-id: svn://10.0.0.236/trunk@62087 18797224-902f-48f8-a5cc-f745e15eee43 --- .../prefs/resources/content/AccountWizard.js | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/mozilla/mailnews/base/prefs/resources/content/AccountWizard.js b/mozilla/mailnews/base/prefs/resources/content/AccountWizard.js index 6902f01687f..b77a0186016 100644 --- a/mozilla/mailnews/base/prefs/resources/content/AccountWizard.js +++ b/mozilla/mailnews/base/prefs/resources/content/AccountWizard.js @@ -282,32 +282,35 @@ function finishAccount(account, accountData) { accountData.incomingServer); account.incomingServer.valid=true; } + + // copy identity info + var destIdentity = + account.identities.QueryElementAt(0, nsIMsgIdentity); - if (accountData.identity) { + if (accountData.identity && destIdentity) { // fixup the email address if we have a default domain var emailArray = accountData.identity.email.split('@'); - dump("emailArray = " + emailArray + " (length = " + emailArray.length + "\n"); - dump("domain = " + accountData.domain + "\n"); if (emailArray.length < 2 && accountData.domain) { accountData.identity.email += '@' + accountData.domain; } - var destIdentity = - account.identities.QueryElementAt(0, nsIMsgIdentity); copyObjectToInterface(destIdentity, accountData.identity); destIdentity.valid=true; } - if (accountData.smtp) { - var server = smtpService.defaultServer; + var smtpServer = smtpService.defaultServer; - if (accountData.smtpCreateNewServer) - server = smtpService.createSmtpServer(); + if (accountData.smtpCreateNewServer) + smtpServer = smtpService.createSmtpServer(); + + copyObjectToInterface(smtpServer, accountData.smtp); + + // some identities have 'preferred' + if (accountData.smtpUsePreferredServer && destIdentity) + destIdentity.smtpServer = smtpServer; - copyObjectToInterface(server, accountData.smtp); - } }