Add support for sending emails through Microsoft Graph - #71565
Merged
Merged
Conversation
eladkal
reviewed
Aug 13, 2026
rjgoyln
force-pushed
the
feature/msgraph-email-backend
branch
from
August 14, 2026 18:18
486cbf8 to
6e6f3ef
Compare
rjgoyln
marked this pull request as ready for review
August 14, 2026 18:49
eladkal
reviewed
Aug 17, 2026
eladkal
reviewed
Aug 17, 2026
eladkal
reviewed
Aug 24, 2026
Contributor
|
I will try to review this PR tomorrow as I may have some remarks, but I like this, very nice and needed addition! |
dabla
requested changes
Sep 7, 2026
rjgoyln
force-pushed
the
feature/msgraph-email-backend
branch
from
September 7, 2026 16:30
28ec0c9 to
eed625f
Compare
dabla
requested changes
Sep 8, 2026
rjgoyln
force-pushed
the
feature/msgraph-email-backend
branch
2 times, most recently
from
September 8, 2026 16:13
e2b1fce to
0e00ef1
Compare
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.
rjgoyln
force-pushed
the
feature/msgraph-email-backend
branch
from
September 8, 2026 16:39
0e00ef1 to
cb94f03
Compare
dabla
approved these changes
Sep 9, 2026
Contributor
|
Congratulations @rjgoyln, nice work on this PR as this was a most needed feature especially with notifications. |
Contributor
Author
|
Thanks for the review. Really appreciate it! |
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sendMailendpoint over an existingmsgraphconnection, covering both places email is configured:[email] email_backendforemail_on_failureandemail_on_retry, andMSGraphNotifierfor the state-change callbacks. The notifier implementsasync_notify, so it also runs in the triggerer.from_emailselects the mailbox to send from, and Graph addresses that mailbox in the request path — hence theparseaddr, since the option is conventionally configured asDisplay name <user@example.com>, 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.runbound to a closed loop and break the next email.closes: #71541
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines