Closed Bug 1679759 Opened 3 years ago Closed 3 years ago

Exchange autodiscover email redirect nonfunctional

Categories

(Thunderbird :: Account Manager, defect)

defect

Tracking

(thunderbird_esr78 fixed)

RESOLVED FIXED
85 Branch
Tracking Status
thunderbird_esr78 --- fixed

People

(Reporter: neil, Assigned: neil)

References

Details

Attachments

(2 files, 1 obsolete file)

The email redirect functionality in the Exchange autodiscover sequence appears to be based on either outdated or erroneous documentation, so it is checking for the wrong XML elements. Even if the XML elements were correct, the code is attempting to invoke a non-existent function, so the redirect would fail anyway.

Attached patch Proposed patch (obsolete) — Splinter Review
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #9190281 - Flags: review?(ben.bucksch)

Yes, I mis-read the docs: They said 'If the value of the Action element is "Redirect"', which is an attribute value, and I mis-read it as element. I had no test-case, so I couldn't find this.

Comment on attachment 9190281 [details] [diff] [review]
Proposed patch

Review of attachment 9190281 [details] [diff] [review]:
-----------------------------------------------------------------

r+, with the changes mentioned.

::: mail/components/accountcreation/content/sanitizeDatatypes.js
@@ +118,5 @@
> +   * A value which resembles an email address.
> +   */
> +  emailAddress(unchecked) {
> +    let str = this.nonemptystring(unchecked);
> +    if (!/^[a-z0-9\-%+_\.\*]+@[a-z0-9\-\.]+\.[a-z]+$/.test(str)) {

Compare `emailRE` in emailWizard.js.

We should move that here and use `sanitize.emailAddress()` within emailWizard.js  `validateEmail()`.
Attachment #9190281 - Flags: review?(ben.bucksch) → review-

Thanks!

(In reply to Ben Bucksch from comment #2)

Yes, I mis-read the docs. I had no test-case, so I couldn't find this.

Actually that document itself contained an erroneous example of the non-existent element, so it's not surprising that you were confused.

(In reply to Ben Bucksch from comment #3)

Compare emailRE in emailWizard.js.

We should move that here and use sanitize.emailAddress() within emailWizard.js validateEmail().

I had a look at validateEmail and it's just used to display a hint, so calling sanitize.emailAddress() appears to be inappropriate. But I could still use emailRE from emailWizard.js if you think it's appropriate to use.

Comment on attachment 9190281 [details] [diff] [review]
Proposed patch

OK, r=BenB

Attachment #9190281 - Flags: review- → review+

Please attach a sample xml for this, which we could use for testing and also automated tests.

Target Milestone: --- → 85 Branch
Comment on attachment 9190281 [details] [diff] [review]
Proposed patch

Review of attachment 9190281 [details] [diff] [review]:
-----------------------------------------------------------------

Also, please set up hg properly so that the patch header contains the user details.

Please attach a sample xml for this, which we could use for testing and also automated tests.

Good idea

Attachment #9190281 - Attachment is obsolete: true
Attachment #9193054 - Flags: review+

(In reply to Magnus Melin from comment #7)

Please attach a sample xml for this, which we could use for testing

I'm writing a detailed comment on what would be required to test this manually, at least.

The most common use of this feature is in a hybrid Exchange scenario, but for testing purposes we can use a regular Exchange account. This will be the destination account listed in the dummy XML. I’ll assume that Autodiscover already works for this account. Since we’re not using hybrid Exchange, the source account must not be an Exchange account, so that we can set up the dummy XML for it.

The dummy XML must be accessible at one of the three supported Autodiscover locations:

A real Autodiscover Server would authenticate the https: connections so that it can provide a user-specific redirect address although for testing purposes Thunderbird will accept a "static" unauthenticated document.

I understand that Ben is willing to host a script on the beonex.com domain which will respond with an XML file that will redirect to an Exchange email address of your choice.

Ben is willing to host a script on the beonex.com domain

Actually, I can only host static files (via HTTP GET), not scripts. Given that HTTP POST is required, I don't think that will work.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/df66147d9492
Use correct XML elements to detect email autodiscover redirection r=BenB

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

I assume 78 is affected as well?

Yes, sir!

We still need to change the login email address to the redirected one, though. UPDATE: That's bug 1682890.

I'll file a new bug for that to make it easier to keep track.

Blocks: 1682890

Comment on attachment 9193054 [details] [diff] [review]
Patch with HG headers

[Approval Request Comment]
User impact if declined: Certain users whose server uses the RedirectAddr feature cannot set up their account
Testing completed (on c-c, etc.): Bake a few days on trunk
Risk to taking this patch (and alternatives if risky): Old code was completely broken (based on faulty spec). Risk close to zero.
Should be landed together with bug 1682890.

Attachment #9193054 - Flags: approval-comm-esr78?

Comment on attachment 9193054 [details] [diff] [review]
Patch with HG headers

[Triage Comment]
Approved for esr78

Attachment #9193054 - Flags: approval-comm-esr78? → approval-comm-esr78+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: