Commit 3241e651 authored by anonym's avatar anonym
Browse files

xxx

parent 5b161a79
From bdf2874f60fada9a894c5be4f4846ed2fbc2c124 Mon Sep 17 00:00:00 2001
From: anonym <anonym@riseup.net>
Date: Fri, 24 Apr 2020 16:01:39 +0200
Subject: [PATCH 4/4] Fix buggy pref for disabling MS Exchange autoconfig
method.
Before the upstream work that made the autoconfig methods happen in
parallel this was working, but when I adapted it to that work I seem
to have made a mistake or misunderstood something. In fact, the error
propagation now happens in a way that makes it very unsuitable to have
this check this deep down in the call stack. The check should happen
earlier.
So let's just not initiate this autoconfig method at all when
disabled, with the added benefit of it not showing up as an
immediately failed method in the list of attempts. This makes so much
more sense!
While we're at it, let's do the same for when the MX method is
disabled since there is no reason for it to be listed as a failure
when disabled either.
---
.../accountcreation/content/emailWizard.js | 91 ++++++++++---------
.../content/exchangeAutoDiscover.js | 10 --
2 files changed, 50 insertions(+), 51 deletions(-)
diff --git a/comm/mail/components/accountcreation/content/emailWizard.js b/comm/mail/components/accountcreation/content/emailWizard.js
index b677bb718cd..deff02f74ad 100644
--- a/comm/mail/components/accountcreation/content/emailWizard.js
+++ b/comm/mail/components/accountcreation/content/emailWizard.js
@@ -757,51 +757,60 @@ EmailConfigWizard.prototype = {
);
call.setAbortable(fetch);
- call = priority.addCall();
- this.addStatusLine("looking_up_settings_mx", call);
- // "found_settings_db" is correct. We display the same message for both db and mx cases.
- call.foundMsg = "found_settings_db";
- fetch = fetchConfigForMX(
- domain,
- call.successCallback(),
- call.errorCallback()
- );
- call.setAbortable(fetch);
+ if (Services.prefs.getBoolPref("mailnews.auto_config.mx.enabled", true)) {
+ call = priority.addCall();
+ this.addStatusLine("looking_up_settings_mx", call);
+ // "found_settings_db" is correct. We display the same message for both db and mx cases.
+ call.foundMsg = "found_settings_db";
+ fetch = fetchConfigForMX(
+ domain,
+ call.successCallback(),
+ call.errorCallback()
+ );
+ call.setAbortable(fetch);
+ }
- call = priority.addCall();
- this.addStatusLine("looking_up_settings_exchange", call);
- call.foundMsg = "found_settings_exchange";
- fetch = fetchConfigFromExchange(
- domain,
- emailAddress,
- this._exchangeUsername,
- this._password,
- call.successCallback(),
- (e, allErrors) => {
- // Must call error callback in any case to stop the discover mode.
- let errorCallback = call.errorCallback();
- if (e instanceof CancelledException) {
- errorCallback(e);
- } else if (allErrors && allErrors.some(e => e.code == 401)) {
- // Auth failed.
- // Ask user for username.
- this.onStartOver();
- this.stopSpinner(); // clears status message
- _show("usernameRow");
- _show("status-area");
- if (!this._exchangeUsername) {
- this.showErrorStatus("credentials_incomplete");
+ if (
+ Services.prefs.getBoolPref(
+ "mailnews.auto_config.fetchFromExchange.enabled",
+ true
+ )
+ ) {
+ call = priority.addCall();
+ this.addStatusLine("looking_up_settings_exchange", call);
+ call.foundMsg = "found_settings_exchange";
+ fetch = fetchConfigFromExchange(
+ domain,
+ emailAddress,
+ this._exchangeUsername,
+ this._password,
+ call.successCallback(),
+ (e, allErrors) => {
+ // Must call error callback in any case to stop the discover mode.
+ let errorCallback = call.errorCallback();
+ if (e instanceof CancelledException) {
+ errorCallback(e);
+ } else if (allErrors && allErrors.some(e => e.code == 401)) {
+ // Auth failed.
+ // Ask user for username.
+ this.onStartOver();
+ this.stopSpinner(); // clears status message
+ _show("usernameRow");
+ _show("status-area");
+ if (!this._exchangeUsername) {
+ this.showErrorStatus("credentials_incomplete");
+ } else {
+ this.showErrorStatus("credentials_wrong");
+ }
+ _enable("manual-edit_button");
+ errorCallback(new CancelledException());
} else {
- this.showErrorStatus("credentials_wrong");
+ errorCallback(e);
}
- _enable("manual-edit_button");
- errorCallback(new CancelledException());
- } else {
- errorCallback(e);
}
- }
- );
- call.setAbortable(fetch);
+ );
+ call.setAbortable(fetch);
+ }
} catch (e) {
// e.g. when entering an invalid domain like "c@c.-com"
this.showErrorMsg(e);
diff --git a/comm/mail/components/accountcreation/content/exchangeAutoDiscover.js b/comm/mail/components/accountcreation/content/exchangeAutoDiscover.js
index 307e8c884d2..82c60099098 100644
--- a/comm/mail/components/accountcreation/content/exchangeAutoDiscover.js
+++ b/comm/mail/components/accountcreation/content/exchangeAutoDiscover.js
@@ -48,16 +48,6 @@ function fetchConfigFromExchange(
) {
assert(typeof successCallback == "function");
assert(typeof errorCallback == "function");
- if (
- !Services.prefs.getBoolPref(
- "mailnews.auto_config.fetchFromExchange.enabled",
- true
- )
- ) {
- errorCallback("Exchange AutoDiscover disabled per user preference");
- return new Abortable();
- }
-
// <https://technet.microsoft.com/en-us/library/bb124251(v=exchg.160).aspx#Autodiscover%20services%20in%20Outlook>
// <https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-interoperability-guidance/hh352638(v%3Dexchg.140)>, search for "The Autodiscover service uses one of these four methods"
let url1 =
--
2.28.0
......@@ -40,5 +40,4 @@ fixes/reduce-the-rust-debuginfo-level-on-selected-architectures.patch
porting-s390x/Explicitly-instantiate-TIntermTraverser-traverse-TIntermN.patch
secure-account-creation/Prefer-fetched-configurations-using-SSL-over-plainte.patch
secure-account-creation/Add-pref-for-whether-we-accept-OAuth2-during-autocon.patch
secure-account-creation/Fix-buggy-pref-for-disabling-MS-Exchange-autoconfig-.patch
secure-account-creation/Don-t-reset-encryption-choice-when-disabling-encrypt.patch
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment