Jenkins email notifications (Mailer and Email Extension plugins) with Microsoft 365: email through Microsoft 365 after Basic auth ends
Short answer: The Mailer plugin only logs in with a user name and password, so it fails once Basic auth is off. Email Extension has a Use OAuth 2.0 box, but it doesn't fetch or refresh a Microsoft token. The working fix is a relay connector: SMTP server = your MX host, port 25, no credentials.
Deadline: Microsoft 365 turns off SMTP AUTH Basic auth by default at the end of December 2026 – dates and background.
Modern authentication (OAuth) support
Mailer (Manage Jenkins → Configure System → E-mail Notification): Use SMTP Authentication with a user name and password, nothing else. Its code has no OAuth option. Email Extension (section Extended E-mail Notification) has a Use OAuth 2.0 checkbox under Advanced. In the plugin's source it only switches the SMTP login to XOAUTH2 and sends the password of the selected Credentials as the token; it doesn't request or refresh a token from Microsoft. Jenkins issue JENKINS-73486 ("OAuth 2.0 does not work with O365", In Progress) reports that a client secret in that field fails with 535 5.7.3, and that a token fetched by hand works but is only valid for about an hour. Jenkins selected a 2026 Google Summer of Code project to add Microsoft OAuth (client credentials) to Email Extension; it is not in a release yet. Until then, a Jenkins account on smtp.office365.com is hit by the SMTP AUTH Basic auth switch-off.
What you will see when it breaks
- "535 5.7.3 Authentication unsuccessful" (Microsoft Learn: SMTP AUTH or XOAUTH2 login refused)
- "5.7.57 Client not authenticated to send mail" (Microsoft Learn: the SMTP AUTH login didn't succeed)
- Reported: AUTH XOAUTH2 failed ... 535 5.7.3 Authentication unsuccessful with Use OAuth 2.0 and the app's client secret as the password (Jenkins issue JENKINS-73486)
- Reported: Email Extension with OAuth works for about an hour, then fails again (JENKINS-73486: the hand-fetched access token expired)
- Test configuration in E-mail Notification stops working after Basic auth is switched off (Mailer only logs in with a user name and password)
Best fix
- Check both sections under Manage Jenkins → Configure System: E-mail Notification (Mailer) and Extended E-mail Notification (Email Extension).
smtp.office365.comwith a user name and password or Credentials is Basic auth and fails once Microsoft turns it off by default at the end of December 2026. The free SMTP AUTH sender script shows whether the Jenkins mailbox still logs in over SMTP AUTH. - Create a relay connector in Exchange admin center (Mail flow → Connectors, from Your organization's email server) that trusts the static public IP your Jenkins controller sends from.
- Mailer (E-mail Notification): SMTP server your MX host (for example
contoso-com.mail.protection.outlook.com), SMTP Port 25, untick Use SMTP Authentication, untick Use SSL (that is implicit SSL, port 465) and tick Use TLS (STARTTLS). - Email Extension (Extended E-mail Notification): same SMTP server and SMTP Port 25. Under Advanced, set Credentials to none, untick Use SSL and Use OAuth 2.0. Check any extra SMTP accounts in that section too.
- Make sure the sender address is in a domain your tenant owns, or Microsoft 365 rejects it (see 550 5.7.64 TenantAttribution).
- Tick Test configuration by sending test e-mail in E-mail Notification, enter a recipient and click Test configuration. Then run a job with an email step.
If it can't do OAuth
- No static IP (for example Jenkins in a cloud with changing egress)? Point Jenkins at a local SMTP relay that signs in to Microsoft 365 itself. Jenkins only needs an SMTP server and port.
- Without a connector, the MX host on port 25 is direct send: it only reaches mailboxes inside your organization (Microsoft Learn). If your tenant rejects it, see 550 5.7.68.
- Email Extension with Use OAuth 2.0 plus a token you fetch yourself (Entra app with
SMTP.SendAsApp,New-ServicePrincipal,Add-MailboxPermission, scopehttps://outlook.office365.com/.default) can send, but JENKINS-73486 reports the token must be replaced about every hour. Not a set-and-forget fix. - Stopgap only: an admin can turn Basic auth for SMTP AUTH back on for now. It ends when Microsoft removes it for good; the date is due in the second half of 2027. See the SMTP AUTH change.
| Mailer path | Manage Jenkins > Configure System > E-mail Notification |
|---|---|
| Mailer fields | SMTP server, Default user e-mail suffix, Use SMTP Authentication (User Name, Password), Use SSL, Use TLS, SMTP Port, Reply-To Address, Charset |
| Email Extension path | Manage Jenkins > Configure System > Extended E-mail Notification |
| Email Extension account fields | SMTP server, SMTP Port (default 25); Advanced: Credentials, Use SSL, Use TLS, Use OAuth 2.0, Advanced Email Properties |
| Use OAuth 2.0 (Email Extension) | Sets XOAUTH2 and sends the credential password as the token; no Microsoft token request or refresh |
| Mailer OAuth | Not documented (password login only) |
| Use SSL vs Use TLS | Use SSL = implicit SSL (465 if no port set); Use TLS = STARTTLS required (587 if no port set) |
| Relay values | SMTP server: your MX host, SMTP Port: 25, no authentication or Credentials, OAuth off |
| Microsoft OAuth status in Email Extension | JENKINS-73486 In Progress; GSoC 2026 project selected, not released |
Check your domain's SPF and DMARC
A relay sends from your office IP, so it must be in your SPF record.
Get the kit ($19)
Rather have it done for you? I move your devices and apps on Fiverr – relay, Direct Send or OAuth, tested, from $25.
Sources
- Jenkins plugins: Email Extension (configuration, Extended E-mail Notification)
- Jenkins plugins: Mailer (E-mail Notification fields)
- GitHub jenkinsci/email-ext-plugin: MailAccount config (SMTP account fields, Use OAuth 2.0)
- GitHub jenkinsci/email-ext-plugin: ExtendedEmailPublisherDescriptor (XOAUTH2 handling)
- GitHub jenkinsci/mailer-plugin: Mailer.java (SMTP session, SSL/TLS, password authenticator)
- Jenkins Jira: JENKINS-73486 Email Extension: OAuth 2.0 does not work with O365
- Jenkins Jira: JENKINS-69414 Email Extension plugin and OAuth 2.0 query
- Jenkins: GSoC 2026 project, Jenkins email notifications using Outlook SMTP with OAuth
- Microsoft Learn: Authenticate an IMAP, POP or SMTP connection using OAuth
- Microsoft Learn: Enable or disable SMTP AUTH in Exchange Online
- Microsoft Learn: How to set up a multifunction device or application to send email using Microsoft 365
- Microsoft Learn: Fix issues with printers, scanners, and LOB apps that send email using Microsoft 365
- Microsoft Exchange Team: Updated Exchange Online SMTP AUTH Basic Authentication deprecation timeline (MC786329)
Other devices and apps
- HP printers and MFPs
- Canon imageRUNNER ADVANCE and i-SENSYS/imageCLASS
- Ricoh MFPs and printers
- Xerox AltaLink and VersaLink
- Brother printers, MFCs and scanners
- Konica Minolta bizhub
- Kyocera TASKalfa and ECOSYS
- Sharp MX and BP series
- Lexmark
- Epson WorkForce and EcoTank business
- Toshiba e-STUDIO (e-BRIDGE Next) scan to email with Microsoft 365
- FUJIFILM Apeos and ApeosPort (formerly Fuji Xerox) scan to email with Microsoft 365
- WordPress SMTP plugins (WP Mail SMTP, FluentSMTP, Post SMTP) with Microsoft 365
- Synology DSM and QNAP QTS / QuTS hero email notifications with Microsoft 365
- PowerShell Send-MailMessage with Microsoft 365
- Veeam Backup & Replication email notifications with Microsoft 365
- Zabbix email media type with Microsoft 365
- Paessler PRTG Network Monitor email notifications with Microsoft 365
- Windows Server IIS 6.0 SMTP relay forwarding app mail to Microsoft 365
- Sage 50 Accounts (UK and Ireland) and Sage 200 emailing invoices with Microsoft 365
- QuickBooks Desktop emailing invoices with Microsoft 365 (Web Mail or Outlook)
- Microsoft SQL Server Database Mail (and SQL Agent alerts) with Microsoft 365
- Dell iDRAC and HPE iLO alert email (AlertMail) with Microsoft 365
- Microsoft 365 SMTP relay connector (any printer, scanner, NAS or app)