Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing SMTP user and password from airflow.cfg or environment variables #45114

Closed
1 of 2 tasks
BalaMuralibi opened this issue Dec 20, 2024 · 3 comments · May be fixed by #45189
Closed
1 of 2 tasks

Providing SMTP user and password from airflow.cfg or environment variables #45114

BalaMuralibi opened this issue Dec 20, 2024 · 3 comments · May be fixed by #45189
Labels
area:core invalid kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet

Comments

@BalaMuralibi
Copy link

BalaMuralibi commented Dec 20, 2024

Apache Airflow version

2.10.4

If "Other Airflow 2 version" selected, which one?

No response

What happened?

Currently airflow smtp email.py utils is not taking user, password values from airflow.cfg/env variables, rather it gets user, password values from smtp connection https://github.com/apache/airflow/blob/main/airflow/utils/email.py#L245-L246

AIRFLOW__EMAIL__EMAIL_BACKEND: airflow.utils.email.send_email_smtp
AIRFLOW__SMTP__SMTP_HOST: host
AIRFLOW__SMTP__SMTP_STARTTLS: true
AIRFLOW__SMTP__SMTP_SSL: False
AIRFLOW__SMTP__SMTP_USER: "user@domain"
AIRFLOW__SMTP__SMTP_PASSWORD: 'pwd'
AIRFLOW__SMTP__SMTP_PORT: 25
AIRFLOW__SMTP__SMTP_MAIL_FROM: [email protected] 

What you think should happen instead?

In production its not realistic to manually supply smtp user password in connection, thus it would be ideal to consider to get user and password from airflow.cfg in case they are supplied AIRFLOW__SMTP__SMTP_USER: "user@domain" AIRFLOW__SMTP__SMTP_PASSWORD: 'pwd' .

How to reproduce

na

Operating System

na

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

Please suggest if there is a work around to provide smtp password securely.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@BalaMuralibi BalaMuralibi added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Dec 20, 2024
Copy link

boring-cyborg bot commented Dec 20, 2024

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@potiuk
Copy link
Member

potiuk commented Dec 20, 2024

@potiuk potiuk closed this as completed Dec 20, 2024
@potiuk potiuk added the invalid label Dec 20, 2024
@potiuk
Copy link
Member

potiuk commented Dec 20, 2024

For the future - please use discussions if you have a question or doubt of that sort. Issues are for reporting problems that are airflow problems and when you want to do something and do not know how, open discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core invalid kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants