github-actions[bot] opened a new pull request, #75709: URL: https://github.com/apache/airflow/pull/75709
* Deprecate airflow.utils.email in favor of the SMTP provider The email utilities now live in airflow.providers.smtp.utils.emailer. airflow.utils.email keeps its public names as deprecated aliases of the provider functions, so existing imports and email_backend settings keep working with a DeprecatedImportWarning. The default [email] email_backend value is unchanged. The Task SDK treats it as "no custom backend" and sends alerts with SmtpNotifier, as before. A regression test covers email sent from a server process, such as a listener in the API server, with the SMTP login stored only in the metadata database. airflow-core now requires apache-airflow-providers-smtp>=3.2.0, the first release that contains the emailer module. * Keep star imports of airflow.utils.email working and document the move "from airflow.utils.email import *" imported the email functions before they moved to the SMTP provider. Listing them in __all__ keeps that import working, with the same deprecation warning as named imports. The email configuration guide now says where the functions live, that the default email_backend value is unchanged, and that the moved functions do not see settings changed at runtime with airflow.configuration.conf.set(). The coverage script entry for airflow/utils/email.py is left unchanged, so this change stays within airflow-core. * Shorten the core email page and point to the SMTP provider docs The SMTP server and connection setup is documented by the SMTP provider, so the core page now only explains email_backend and the [email] options shared by all backends, and links to the provider docs. * Explain what changes for callers of the deprecated email functions Add a significant newsfragment, keep email_backend at its default in the docs note, and name the Connection lookup and configuration source in the deprecation warning. * Test that a plain script does not see a database-only SMTP Connection Outside task and server processes the Connection lookup only searches environment variables and secrets backends, so the email is sent without a login. The newsfragment describes this; the test now covers it. (cherry picked from commit ad6ec79c73ef7362a2b3f213cae904c893e2f299) Co-authored-by: Shivam Rastogi <[email protected]> -- 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]
