summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2020-04-24 16:06:26 +0200
committeranonym <anonym@riseup.net>2020-04-27 11:12:10 +0200
commit14821f72782eb8a5b1c07a4ae22e0fb420a91d28 (patch)
treec78b4618e49a66c7983cc720e7702c9586eaa27f
parent3e79ef04cf56164d519bb6de627e8efa7094c5fa (diff)
Thunderbird: patch to fix buggy MS Exchange autoconfig pref.bugfix/17654-disable-exchange-autoconfig
When MS Exchange autoconfig is disabled via this pref, the account wizard breaks, making it useless. It seems the work in refs: #6156 did this. The added patch fixes this, and should be upstreamed. Will-fix: #17654
-rw-r--r--config/chroot_local-includes/usr/share/tails/build/thunderbird-patches/Fix-buggy-pref-for-disabling-MS-Exchange-autoconfig-.patch143
-rw-r--r--config/chroot_local-includes/usr/share/tails/build/thunderbird-patches/series3
2 files changed, 145 insertions, 1 deletions
diff --git a/config/chroot_local-includes/usr/share/tails/build/thunderbird-patches/Fix-buggy-pref-for-disabling-MS-Exchange-autoconfig-.patch b/config/chroot_local-includes/usr/share/tails/build/thunderbird-patches/Fix-buggy-pref-for-disabling-MS-Exchange-autoconfig-.patch
new file mode 100644
index 0000000..c97c3a1
--- /dev/null
+++ b/config/chroot_local-includes/usr/share/tails/build/thunderbird-patches/Fix-buggy-pref-for-disabling-MS-Exchange-autoconfig-.patch
@@ -0,0 +1,143 @@
+From a95fe8ff521840faffecc89d9ae7a51fccc1ba82 Mon Sep 17 00:00:00 2001
+From: anonym <anonym@riseup.net>
+Date: Fri, 24 Apr 2020 16:01:39 +0200
+Subject: [PATCH] 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 | 81 ++++++++++---------
+ .../content/exchangeAutoDiscover.js | 10 ---
+ 2 files changed, 45 insertions(+), 46 deletions(-)
+
+diff --git a/comm/mail/components/accountcreation/content/emailWizard.js b/comm/mail/components/accountcreation/content/emailWizard.js
+index 3780792641a..0b53b0a498d 100644
+--- a/comm/mail/components/accountcreation/content/emailWizard.js
++++ b/comm/mail/components/accountcreation/content/emailWizard.js
+@@ -677,44 +677,53 @@ 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.getCharPref("mailnews.mx_service_url") != "") {
++ 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 (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");
+- _enable("manual-edit_button");
+- errorCallback(new CancelledException());
+- } else {
+- errorCallback(e);
++ 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 (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");
++ _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 f9d2a6e0d3e..efe9966a600 100644
+--- a/comm/mail/components/accountcreation/content/exchangeAutoDiscover.js
++++ b/comm/mail/components/accountcreation/content/exchangeAutoDiscover.js
+@@ -47,16 +47,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.26.1
+
diff --git a/config/chroot_local-includes/usr/share/tails/build/thunderbird-patches/series b/config/chroot_local-includes/usr/share/tails/build/thunderbird-patches/series
index 129057c..3995506 100644
--- a/config/chroot_local-includes/usr/share/tails/build/thunderbird-patches/series
+++ b/config/chroot_local-includes/usr/share/tails/build/thunderbird-patches/series
@@ -3,4 +3,5 @@ Make-use-of-non-SSL-Exchange-AutoDiscover-methods-op.patch
Add-pref-for-whether-we-accept-OAuth2-during-autocon.patch
Add-pref-for-whether-to-accept-plaintext-protocols-d.patch
Avoid-local-timestamp-disclosure-in-Date-header.patch
-Avoid-spellchecking-language-disclosure-in-Content-Language-header.patch \ No newline at end of file
+Avoid-spellchecking-language-disclosure-in-Content-Language-header.patch
+Fix-buggy-pref-for-disabling-MS-Exchange-autoconfig-.patch \ No newline at end of file