Skip to content

[5.x] Warn super users that Microsoft 365 is ending SMTP password logins - #25891

Merged
chippison merged 11 commits into
5.x-devfrom
smtp-password-login-retirement-warning-5x
Dec 1, 2026
Merged

chippison merged 11 commits into
5.x-devfrom
smtp-password-login-retirement-warning-5x

Conversation

@chippison

@chippison chippison commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Backport of #25819 to 5.x-dev, for 5.14.4. Stacked on #25890 and has to be merged after it.

Changes from the original: leaves out the 6.x-only CoreAdminHome.mailSettingsUpdated event, uses strpos instead of str_starts_with in ManagerTest, and moves the Vue specs to jest. cancel() only unsets the session key when it is set, because PHP 7 raises an "Undefined variable: _SESSION" notice otherwise. The separate-process tests drop @preserveGlobalState disabled, because on PHP 8.5+ php-di 6 prints deprecations in the child process and PHPUnit fails the test. vue/dist is rebuilt by the 5.x build action.

DEV-21141

Microsoft 365 turns off password logins for SMTP by default from the end of December 2026. This PR warns super users who send Matomo's emails through SMTP with a password, so they can switch to OAuth 2.0 before scheduled reports and alerts stop being sent.

It builds on #25890, which adds the OAuth 2.0 fields to the email settings form.

Changes

  • New closable warning for super users on admin pages, shown when [mail] uses SMTP with a login method other than OAuth 2.0. It links to the email settings and to Microsoft's announcement.
  • The warning lives in CoreAdminHome (SmtpBasicAuthRetirementNotification) and is posted from the Controller.triggerAdminNotifications event, so core's ControllerAdmin is not changed.
  • The warning goes to every SMTP password login, whatever the server is. The server address alone can't tell reliably whether Microsoft 365 is behind it.
  • Where the email settings can't be changed in the UI (enable_general_settings_admin = 0 or multi_server_environment = 1), the warning has a different body that tells the user to switch to OAuth 2.0 in the [mail] section of config/config.ini.php, with no link to the settings page.
  • It isn't shown on Matomo Cloud, which doesn't send through the [mail] settings, to the anonymous user, or on requests authenticated with a token_auth.
  • It stays visible on report pages until it is closed. Once closed, it stays closed until the user signs out.
  • Saving the email settings with OAuth 2.0 (or without SMTP) removes it, on the server and on the open page. A save that still uses a password login leaves it in place.
  • If the settings go back to a password login later, the warning shows again, also in the same session.
  • It can be turned off with [General] disabled_notifications[] = SmtpBasicAuthRetirementMicrosoft, for instances that don't send through Microsoft 365.
  • ManagerTest::testListenNotToControllerMethodEventsThatDoesNotExists now only checks Controller.$module.$action hooks. It assumed every Controller.* hook has that shape, and CoreAdminHome is the first plugin in this repository to listen to Controller.triggerAdminNotifications.

Follow-up

Testing

  • Integration tests for the mail config check and for when the warning is posted, cancelled, kept closed and shown again, and controller tests for what a save returns and removes.
  • Vue component tests for removing the warning from the page after a save, and for keeping it.
  • UI test for the warning, its links, closing it, and the OAuth 2.0 option on the linked settings page.

Checklist
[✔] I have understood, reviewed, and tested all AI outputs before use
[✔] All AI instructions respect security, IP, and privacy rules

Backport of #25723. Typed properties, named arguments and the never and mixed types are rewritten for PHP 7.2.
Backport of #25724. Leaves out the 6.x-only mailSettingsUpdated event, adds the General_InvalidValueForParameter text 5.x lacked, and moves the specs to jest.
Backport of #25819. Leaves out the 6.x-only mailSettingsUpdated event and moves the specs to jest.
@chippison chippison added this to the 5.14.4 milestone Dec 1, 2026
chippison and others added 7 commits December 1, 2026 17:07
…shot

Http::sendHttpRequestBy no longer declares @throws, so the CliMulti entry no longer matches. The screenshot shows the new [mail] oauth settings.
cancel() only unsets the session key when it is set, and the tests keep global state so php-di's deprecations stay hidden on PHP 8.5+.
…-login-retirement-warning-5x

# Conflicts:
#	plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js
#	plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js
tzi
tzi previously approved these changes Dec 1, 2026
@tzi
tzi marked this pull request as ready for review December 1, 2026 19:31
@chippison
chippison force-pushed the dev-21041-smtp-oauth-settings-ui-5x branch from 4761881 to ff55e15 Compare December 1, 2026 20:33
Base automatically changed from dev-21041-smtp-oauth-settings-ui-5x to 5.x-dev December 1, 2026 21:41
@chippison
chippison dismissed tzi’s stale review December 1, 2026 21:41

The base branch was changed.

@chippison
chippison enabled auto-merge (squash) December 1, 2026 22:11
@chippison
chippison merged commit 20371f4 into 5.x-dev Dec 1, 2026
493 of 498 checks passed
@chippison
chippison deleted the smtp-password-login-retirement-warning-5x branch December 1, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants