Outlook OAuth

master
M66B 2 weeks ago
parent d484d0378d
commit 557bf23851

@ -682,7 +682,7 @@ Some people ask:
>
> "*To help keep your account secure, starting May 30, 2022, Google will no longer support the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.*"
>
> ✔ If you authorized your Gmail account with the quick setup wizard or manually with an app password, your account will keep being synchronized after May 30, 2022.
> ✅ If you authorized your Gmail account with the quick setup wizard or manually with an app password, your account will keep being synchronized after May 30, 2022.
>
> ❌ If you enabled *Less secure apps* in the Google account settings and authorized your Gmail account manually with your normal account password, your account can't be synchronized from May 30, 2022 anymore. The app will show the error **Invalid credentials (Failure)**.
>
@ -1253,12 +1253,39 @@ Using the search index is a pro feature.
🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https%3A%2F%2Fm66b.github.io%2FFairEmail%2F%23faq14)
<br />
>
> **IMPORTANT: If you came here via a warning in the app, you MUST take action!**
>
> It takes just two minutes to be prepared.
>
> **Important**: Basic Authentication (=password authentication) [will be turned off from October 1, 2022](https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-deprecation-in-exchange-online-may-2022/ba-p/3301866).
<br />
>
> &#x2714; If you authorized your Outlook/Office 365 account with the quick setup wizard, your account will keep being synchronized after October 1, 2022.
> **Important**: Basic Authentication [will be turned off for Office 365 accounts from October 1, 2022](https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-deprecation-in-exchange-online-may-2022/ba-p/3301866).
>
> &#x274C; If you authorized your Outlook/Office 365 account manually with a password, your account can't be synchronized from October 1, 2022 anymore.
> **Important**: Basic Authentication **[will be turned off for Outlook/Hotmail/Live accounts from September 16, 2024](https://techcommunity.microsoft.com/t5/outlook-blog/keeping-our-outlook-personal-email-users-safe-reinforcing-our/ba-p/4164184)**.
>
<br />
>
> Microsoft calls password authentication "*Basic authentication*" and authentication with OAuth "*Modern authentication*".
> Confusingly, using [OAuth](https://en.wikipedia.org/wiki/OAuth) also requires entering a password.
>
<br />
>
> &#x2705; If you authorized your Outlook/Office 365 account with the quick setup wizard, your account will keep being synchronized after September 16, 2024.
>
> &#x274C; If you authorized your Outlook/Office 365 account manually with a password, **your account won't be synchronized from September 16, 2024 anymore!**
>
<br />
>
> How to check:
>
@ -1267,17 +1294,23 @@ Using the search index is a pro feature.
> * Tap on *Accounts*
> * Find the account in the list
> * If there is a shield icon before the account name (=OAuth), the account will keep working
>
<br />
>
> How to fix:
>
> * Go to the *Settings* via the navigation menu (left side menu)
> * Tap on the *Wizard* button and select *Outlook/Office365 (OAuth)*
> * Tap on the *Wizard* button and select *Outlook/Hotmail/Live (OAuth)* or *Office 365 (OAuth)*.
> * Tick the checkbox to authenticate an existing account (else you'll create a new account!)
> * Fill in the fields and follow the steps
> * Repeat for each account
>
An Outlook / Live / Hotmail account can be set up via the quick setup wizard and selecting *Outlook/Office 365*.
<br />
An Outlook / Live / Hotmail account can be set up via the quick setup wizard and selecting *Outlook/Hotmail/Live (OAuth)* or *Office 365 (OAuth)*.
**Important**: a personal and a business account can have the same email address, but have different mailboxes (folders). So, please make sure you select the right option.
@ -1294,6 +1327,8 @@ So, basically this means that Microsoft is pushing you to their own products. Is
To use an Outlook, Live or Hotmail account with two factor authentication enabled, you might need to create an app password.
See [here](https://support.microsoft.com/en-us/help/12409/microsoft-account-app-passwords-two-step-verification) for the details.
**Important**: Microsoft will drop support for app passwords from September 16, 2024.
See [here](https://support.office.com/en-us/article/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040) for Microsoft's instructions.
Please see [this FAQ](#faq139) for possible causes of the error *... User is authenticated but not connected ...*.

@ -450,6 +450,7 @@ public class FragmentMessages extends FragmentBase
private static final long REVIEW_ASK_DELAY = 14 * 24 * 3600 * 1000L; // milliseconds
private static final long REVIEW_LATER_DELAY = 3 * 24 * 3600 * 1000L; // milliseconds
private static final long OUTLOOK_CHECK_INTERVAL = 7 * 24 * 3600 * 1000L; // milliseconds
static final List<String> SORT_DATE_HEADER = Collections.unmodifiableList(Arrays.asList(
"time", "unread", "starred", "priority"
@ -5906,78 +5907,47 @@ public class FragmentMessages extends FragmentBase
private boolean checkOutlook() {
final Context context = getContext();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.getBoolean("outlook_checked", false))
return false;
Calendar cal = Calendar.getInstance();
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.MONTH, Calendar.OCTOBER);
cal.set(Calendar.YEAR, 2022);
long outlook_last_checked = prefs.getLong("outlook_last_checked", 0);
long now = new Date().getTime();
if (now < cal.getTimeInMillis() - 30 * 24 * 3600 * 1000L)
return false; // Not yet
if (Helper.getInstallTime(context) > cal.getTimeInMillis()) {
prefs.edit().putBoolean("outlook_checked", true).apply();
return false;
}
cal.add(Calendar.MONTH, 2);
if (now > cal.getTimeInMillis()) {
prefs.edit().putBoolean("outlook_checked", true).apply();
if (outlook_last_checked + OUTLOOK_CHECK_INTERVAL > now)
return false;
}
new SimpleTask<List<EntityAccount>>() {
@Override
protected List<EntityAccount> onExecute(Context context, Bundle args) throws Throwable {
DB db = DB.getInstance(context);
return db.account().getAccounts();
if (BuildConfig.DEBUG)
return db.account().getAccounts();
return db.account().getSynchronizingAccounts(null);
}
@Override
protected void onExecuted(Bundle args, List<EntityAccount> accounts) {
int oauth = 0;
int passwd = 0;
if (accounts != null)
for (EntityAccount account : accounts)
if (account.isOutlook()) {
String user = (account.user == null ? "" : account.user.toLowerCase(Locale.ROOT));
if (user.contains("@hotmail") || user.contains("@live"))
continue;
if (account.auth_type == ServiceAuthenticator.AUTH_TYPE_OAUTH)
oauth++;
else if (account.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD)
passwd++;
}
if (account.isOutlook() &&
account.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD)
passwd++;
if (oauth + passwd == 0) {
prefs.edit().putBoolean("outlook_checked", true).apply();
if (passwd == 0)
return;
}
final int resid = (passwd > 0
? R.string.title_check_outlook_password
: R.string.title_check_outlook_oauth);
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, resid, Snackbar.LENGTH_INDEFINITE));
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_check_outlook_password, Snackbar.LENGTH_INDEFINITE));
Helper.setSnackbarLines(snackbar, 5);
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
@Override
public void onClick(View v) {
snackbar.dismiss();
Helper.viewFAQ(v.getContext(), 14);
prefs.edit().putBoolean("outlook_checked", true).apply();
prefs.edit().putLong("outlook_last_checked", now).apply();
}
});
snackbar.addCallback(new Snackbar.Callback() {
@Override
public void onDismissed(Snackbar transientBottomBar, int event) {
prefs.edit().putBoolean("outlook_checked", true).apply();
prefs.edit().putLong("outlook_last_checked", now).apply();
}
});
snackbar.show();

@ -333,7 +333,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"accept_space", "accept_unsupported",
"junk_hint",
"last_update_check", "last_announcement_check",
"motd"
"motd",
"outlook_last_checked"
};
@Override

@ -398,8 +398,8 @@
<string name="title_check_gmail_oauth">Your Gmail accounts will continue to work after May 30, 2022</string>
<string name="title_check_gmail_password">Some of your Gmail accounts may stop working after May 30, 2022</string>
<string name="title_check_outlook_oauth">Your Outlook accounts will continue to work after October 1, 2022</string>
<string name="title_check_outlook_password">Some of your Outlook accounts may stop working after October 1, 2022</string>
<string name="title_check_outlook_oauth" translatable="false">Your Outlook accounts will continue to work after September 16, 2024</string>
<string name="title_check_outlook_password">Some of your Outlook/Hotmail/Live accounts will stop working after September 16, 2024</string>
<string name="title_advanced_hint_title">More advanced options</string>
<string name="title_advanced_hint_message">

@ -580,7 +580,7 @@
<blockquote>
<p><strong>Important: using your <em>account</em> password <a href="https://support.google.com/accounts/answer/6010255">wont be possible anymore from May 30, 2022</a>.</strong></p>
<p><em>To help keep your account secure, starting May 30, 2022, Google will no longer support the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.</em></p>
<p> If you authorized your Gmail account with the quick setup wizard or manually with an app password, your account will keep being synchronized after May 30, 2022.</p>
<p> If you authorized your Gmail account with the quick setup wizard or manually with an app password, your account will keep being synchronized after May 30, 2022.</p>
<p>❌ If you enabled <em>Less secure apps</em> in the Google account settings and authorized your Gmail account manually with your normal account password, your account cant be synchronized from May 30, 2022 anymore. The app will show the error <strong>Invalid credentials (Failure)</strong>.</p>
<p>How to check:</p>
<ul>
@ -822,10 +822,27 @@ keyword:&lt;keyword&gt;</code></pre>
<p><br /></p>
<p><a name="faq14"></a> <strong>(14) How can I set up an Outlook / Live / Hotmail account?</strong></p>
<p>🌎 <a href="https://translate.google.com/translate?sl=en&amp;u=https%3A%2F%2Fm66b.github.io%2FFairEmail%2F%23faq14">Google Translate</a></p>
<p><br /></p>
<blockquote>
<p><strong>IMPORTANT: If you came here via a warning in the app, you MUST take action!</strong></p>
<p>It takes just two minutes to be prepared.</p>
</blockquote>
<p><br /></p>
<blockquote>
<p><strong>Important</strong>: Basic Authentication <a href="https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-deprecation-in-exchange-online-may-2022/ba-p/3301866">will be turned off for Office 365 accounts from October 1, 2022</a>.</p>
<p><strong>Important</strong>: Basic Authentication <strong><a href="https://techcommunity.microsoft.com/t5/outlook-blog/keeping-our-outlook-personal-email-users-safe-reinforcing-our/ba-p/4164184">will be turned off for Outlook/Hotmail/Live accounts from September 16, 2024</a></strong>.</p>
</blockquote>
<p><br /></p>
<blockquote>
<p>Microsoft calls password authentication “<em>Basic authentication</em>” and authentication with OAuth “<em>Modern authentication</em>”. Confusingly, using <a href="https://en.wikipedia.org/wiki/OAuth">OAuth</a> also requires entering a password.</p>
</blockquote>
<p><br /></p>
<blockquote>
<p>✅ If you authorized your Outlook/Office 365 account with the quick setup wizard, your account will keep being synchronized after September 16, 2024.</p>
<p>❌ If you authorized your Outlook/Office 365 account manually with a password, <strong>your account wont be synchronized from September 16, 2024 anymore!</strong></p>
</blockquote>
<p><br /></p>
<blockquote>
<p><strong>Important</strong>: Basic Authentication (=password authentication) <a href="https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-deprecation-in-exchange-online-may-2022/ba-p/3301866">will be turned off from October 1, 2022</a>.</p>
<p>✔ If you authorized your Outlook/Office 365 account with the quick setup wizard, your account will keep being synchronized after October 1, 2022.</p>
<p>❌ If you authorized your Outlook/Office 365 account manually with a password, your account cant be synchronized from October 1, 2022 anymore.</p>
<p>How to check:</p>
<ul>
<li>Go to the <em>Settings</em> via the navigation menu (left side menu)</li>
@ -834,22 +851,27 @@ keyword:&lt;keyword&gt;</code></pre>
<li>Find the account in the list</li>
<li>If there is a shield icon before the account name (=OAuth), the account will keep working</li>
</ul>
</blockquote>
<p><br /></p>
<blockquote>
<p>How to fix:</p>
<ul>
<li>Go to the <em>Settings</em> via the navigation menu (left side menu)</li>
<li>Tap on the <em>Wizard</em> button and select <em>Outlook/Office365 (OAuth)</em></li>
<li>Tap on the <em>Wizard</em> button and select <em>Outlook/Hotmail/Live (OAuth)</em> or <em>Office 365 (OAuth)</em>.</li>
<li>Tick the checkbox to authenticate an existing account (else youll create a new account!)</li>
<li>Fill in the fields and follow the steps</li>
<li>Repeat for each account</li>
</ul>
</blockquote>
<p>An Outlook / Live / Hotmail account can be set up via the quick setup wizard and selecting <em>Outlook/Office 365</em>.</p>
<p><br /></p>
<p>An Outlook / Live / Hotmail account can be set up via the quick setup wizard and selecting <em>Outlook/Hotmail/Live (OAuth)</em> or <em>Office 365 (OAuth)</em>.</p>
<p><strong>Important</strong>: a personal and a business account can have the same email address, but have different mailboxes (folders). So, please make sure you select the right option.</p>
<p>Microsoft said “<em>We have turned off SMTP AUTH for millions of tenants not using it</em>”, which can result in this error message:</p>
<pre><code>535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant.
Visit https://aka.ms/smtp_auth_disabled for more information.</code></pre>
<p>SMTP AUTH is necessary for third party email clients, which is also documented in <a href="https://aka.ms/smtp_auth_disabled">the referenced article</a>. So, basically this means that Microsoft is pushing you to their own products. Isnt this a bit of a monopoly?</p>
<p>To use an Outlook, Live or Hotmail account with two factor authentication enabled, you might need to create an app password. See <a href="https://support.microsoft.com/en-us/help/12409/microsoft-account-app-passwords-two-step-verification">here</a> for the details.</p>
<p><strong>Important</strong>: Microsoft will drop support for app passwords from September 16, 2024.</p>
<p>See <a href="https://support.office.com/en-us/article/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040">here</a> for Microsofts instructions.</p>
<p>Please see <a href="#faq139">this FAQ</a> for possible causes of the error <em>… User is authenticated but not connected …</em>.</p>
<p>For unknown reasons, some Outlook/Hotmail accounts cannot send messages because of the server error <em>535 5.7.3 Authentication unsuccessful</em>. This can be resolved by authenticating the account with an (app) password (see above) instead of with OAuth. You should use the “<em>Other provider</em>” wizard instead of “<em>Outlook / Office 365 (OAuth)</em>” in this case.</p>

Loading…
Cancel
Save