Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#2264 - Remove never-used IMAP_XOAUTH2 option value before it gets more confusing #19243

Merged
merged 2 commits into from
Jan 8, 2021

Conversation

demeritcowboy
Copy link
Contributor

@demeritcowboy demeritcowboy commented Dec 20, 2020

Overview

https://lab.civicrm.org/dev/core/-/issues/2264

Before we knew the full wackiness splendor of OAUTH2, there was an attempt to model it as its own protocol. This never worked so as the 5.23 release was going to press the as-yet-unreleased mail protocol option value was disabled, but left in the database.

Now that (inbound) OAUTH2 is working using a different mechanism, remove this option value before it starts causing confusion.

Before

Confusing.
Backwards compatibility code exists that is almost certainly not being used.

After

Better.
If it happens to be used somehow, there's a message upon upgrade asking person to report what they are doing.

Technical Details

OAUTH2

Comments

Also #18902 (comment)

@civibot
Copy link

civibot bot commented Dec 20, 2020

(Standard links)

@civibot civibot bot added the master label Dec 20, 2020
'auth' => $protocol === 'IMAP_XOAUTH2' ? 'XOAuth2' : 'Password',
// In a simpler world:
// 'auth' => 'Password',
'auth' => 'Password',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@demeritcowboy won't this break the XOUATH2 integration? or am I confused by things here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See it is confusing! No because IMAP_XOAUTH2 is never used. Whether to use oauth2 with imap comes from the settings stored in a different place, via $mailSettings['auth'] below.

I also tested this with the same setup I had used for testing oauth2 before. Still seems to work.

@seamuslee001
Copy link
Contributor

This seems ok to me just noting that the oauth extension alters the mail settings here

$mailSettings['auth'] = 'XOAuth2';
to ensure that the right connection type is used

@eileenmcnaughton
Copy link
Contributor

@totten can you eyeball this one?

@mattwire
Copy link
Contributor

mattwire commented Jan 7, 2021

@demeritcowboy Needs rebase

@totten
Copy link
Member

totten commented Jan 8, 2021

This is a good idea. I did some r-run testing on the upgrader logic, and it worked well. I like how it uses an "OR" condition (i.e. warn if extant civicrm_mail_settings OR if the option-value is enabled).

Pushed up some tweaks to the message text.

Merge on pass.

@seamuslee001 seamuslee001 merged commit 82d42f6 into civicrm:master Jan 8, 2021
@demeritcowboy demeritcowboy deleted the remove-old-xoauth2 branch January 8, 2021 13:18
@demeritcowboy
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants