shivaam opened a new pull request, #75414:
URL: https://github.com/apache/airflow/pull/75414

   **Do not merge until `apache-airflow-providers-smtp` 3.2.0 is released.** 
This PR raises core's minimum SMTP provider to 3.2.0, the first release with 
`airflow.providers.smtp.utils.emailer` (#74623). It is currently `3.2.0rc1` 
(#75332), so the "PyPI constraints" check fails until the final release is out.
   
   This deprecates `airflow.utils.email`. Its functions live in 
`airflow.providers.smtp.utils.emailer`, and the old names now forward to them 
with a `DeprecatedImportWarning`. Existing imports and `email_backend` settings 
keep working. The default `email_backend` is unchanged, so default task alerts 
are still sent by `SmtpNotifier`.
   
   One difference for code that calls these functions directly: the provider 
looks up the SMTP Connection with `BaseHook.get_connection`. Tasks and 
Airflow's server processes still find a Connection stored only in the metadata 
database. A standalone script outside Airflow's processes needs it from an 
environment variable or a secrets backend.
   
   **Testing**
   
   - New tests: the old names resolve to the provider functions, and a server 
process finds a database-only Connection. Both fail against the current module.
   - With SMTP `3.2.0rc1` installed, a real SMTP server (Mailpit) receives task 
retry and failure alerts for the default backend and for a custom backend that 
imports `airflow.utils.email`, and the messages match the original core code.
   
   **What's next**
   
   1. After SMTP 3.2.0 is released: re-run CI and mark this PR ready for review.
   2. A separate provider PR so the SES and SendGrid providers no longer import 
`airflow.utils.email`.
   3. Later: share the MIME helpers between `SmtpHook` and the emailer, and 
move the `[smtp]` settings into the SMTP provider.
   4. In Airflow 4: remove `airflow.utils.email`.
   
   related: #30530, #74623
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.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]

Reply via email to