rjgoyln opened a new pull request, #71565: URL: https://github.com/apache/airflow/pull/71565
## Summary Sending mail from an Office 365 or Outlook cloud mailbox is expected to go through Microsoft Graph, and with EWS gone the SMTP relay into those mailboxes is the last legacy path standing. Airflow could only reach them over SMTP, so a deployment on a Microsoft tenant had no supported way to alert on task failures from its own mailbox. ## Change The Azure provider sends mail through the Graph `sendMail` endpoint over an existing `msgraph` connection, covering both places email is configured: `[email] email_backend` for `email_on_failure` and `email_on_retry`, and `MSGraphNotifier` for the state-change callbacks. The notifier implements `async_notify`, so it also runs in the triggerer. `from_email` selects the mailbox to send from, and Graph addresses that mailbox in the request path — hence the `parseaddr`, since the option is conventionally configured as `Display name <[email protected]>`, the form SMTP and SES accept. Attachments ride inline in the request body rather than through an upload session, which is what bounds them at 3 MB. The email backend contract is synchronous while the Graph hook is async-only. The sync entry point therefore runs the coroutine on its own loop and closes the request adapter before that loop goes away; the cached adapter would otherwise outlive `asyncio.run` bound to a closed loop and break the next email. closes: #71541 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 5) Generated-by: Claude Code (Opus 5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
