【发布时间】:2021-09-17 11:17:45
【问题描述】:
我正在安排从 Airflow 2.1.1 发送电子邮件的任务。 我已经正确配置了airflow.cfg文件中的smtp参数
smtp_host = mr.my_domain.com
smtp_starttls = False
smtp_ssl = True
smtp_user = email@my_domain.com
smtp_password = ********
smtp_port = 465
smtp_mail_from = email@my_domain.com
smtp_timeout = 30
smtp_retry_limit = 5
如果我从 cli 测试任务,电子邮件会正确发送,但我会收到以下警报消息:
..../lib/python3.6/site-packages/airflow/utils/email.py:101 PendingDeprecationWarning: Fetching SMTP credentials from configuration variables will be deprecated in a future release. Please set credentials using a connection instead.
来自 GUI 的消息是:
INFO - Marking task as FAILED.
所以我正在尝试按照文档中的说明创建连接:
https://airflow.apache.org/docs/apache-airflow/stable/howto/email-config.html
要配置 SMTP 凭据,请创建一个名为 smtp_default 的连接,或选择自定义连接名称并将其设置在 email_conn_id 中。
但在创建新连接时,选项中不存在 SMTP。
希望您能帮帮我,非常感谢您。
【问题讨论】: