You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/31 07:17:23 UTC

[GitHub] [airflow] ecerulm opened a new issue #17930: Emails notifications with AWS SES not working due to missing "from:" field

ecerulm opened a new issue #17930:
URL: https://github.com/apache/airflow/issues/17930


   ### Apache Airflow version
   
   main (development)
   
   ### Operating System
   
   macOsS
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon (main)
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   https://github.com/apache/airflow/blob/098765e227d4ab7873a2f675845b50c633e356da/airflow/providers/amazon/aws/utils/emailer.py#L40-L41
   
   ```
       hook.send_email(
           mail_from=None,
           to=to,
           subject=subject,
           html_content=html_content,
           files=files,
           cc=cc,
           bcc=bcc,
           mime_subtype=mime_subtype,
           mime_charset=mime_charset,
       )
   ```
   
   the `mail_from=None` will trigger an error when sending the mail, when using AWS Simple Email Service you  need to provide a from address and has to be already verified in AWS SES >  "Verified identities"
   
   
   
   
   
   ### What you expected to happen
   
   I expected it to send a mail but it doesn't because 
   
   ### How to reproduce
   
   _No response_
   
   ### Anything else
   
   This is easily solved by providing a from address like in: 
   ```
       smtp_mail_from = conf.get('smtp', 'SMTP_MAIL_FROM')
       hook.send_email(
           mail_from=smtp_mail_from,
   ```
   
   the problem is: Can we reuse the smtp.SMTP_MAIL_FROM or do we need to create a new configuration parameter like email.email_from_address ? 
   
      * smtp uses its own config smtp.smtp_mail_from
      * sendgrid uses an environment variable `SENDGRID_MAIL_FROM` (undocumented by the way) 
     
   
   So, my personal proposal is to
   * introduce an email.email_from_email and email.email_from_name 
   * read those new configuration parameters at [utils.email.send_email](https://github.com/apache/airflow/blob/098765e227d4ab7873a2f675845b50c633e356da/airflow/utils/email.py#L50-L67 ) 
   * pass those as arguments to the backend (kwargs `from_email`, `from_name`) . the [sendgrid backend can already read those  ](https://github.com/apache/airflow/blob/098765e227d4ab7873a2f675845b50c633e356da/airflow/providers/sendgrid/utils/emailer.py#L70-L71) although seems unused at the momemt.
   
   
   
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed issue #17930: Emails notifications with AWS SES not working due to missing "from:" field

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #17930:
URL: https://github.com/apache/airflow/issues/17930


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ecerulm commented on issue #17930: Emails notifications with AWS SES not working due to missing "from:" field

Posted by GitBox <gi...@apache.org>.
ecerulm commented on issue #17930:
URL: https://github.com/apache/airflow/issues/17930#issuecomment-920596807


   @potiuk can you assign this to @ignaski who has created PR #18042? 
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ignaski commented on issue #17930: Emails notifications with AWS SES not working due to missing "from:" field

Posted by GitBox <gi...@apache.org>.
ignaski commented on issue #17930:
URL: https://github.com/apache/airflow/issues/17930#issuecomment-920709849


   Hi both, i'm happy to continue and merge the work of @ecerulm and myself


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #17930: Emails notifications with AWS SES not working due to missing "from:" field

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #17930:
URL: https://github.com/apache/airflow/issues/17930#issuecomment-920708244


   I cannot - unless @ignaski comments here :). GitHub does not allow to assign issues to people who did not commented on them  (which makes perfect sense). 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #17930: Emails notifications with AWS SES not working due to missing "from:" field

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #17930:
URL: https://github.com/apache/airflow/issues/17930#issuecomment-909746284


   Go for it @ecerulm ! I think that's good step with straightening email configuration. It requires quite some polishing (I am sure we will find some things to fix as well while we will iterate on the docs on this one - happy to brainstorm then).


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] zachliu edited a comment on issue #17930: Emails notifications with AWS SES not working due to missing "from:" field

Posted by GitBox <gi...@apache.org>.
zachliu edited a comment on issue #17930:
URL: https://github.com/apache/airflow/issues/17930#issuecomment-931715547


   I was led here because of this warning message
   ```
   WARNING - /usr/local/lib/python3.8/site-packages/airflow/utils/email.py:102 PendingDeprecationWarning:
   Fetching SMTP credentials from configuration variables will be deprecated in a future release.
   Please set credentials using a connection instead.
   ```
   then i tried SES and had the same problem. i almost opened up a duplicated issue :joy_cat: 
   for now i just put SES SMTP credentials into a `smtp_default` connection but be careful: https://github.com/apache/airflow/issues/16468#issuecomment-931714174 
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] zachliu commented on issue #17930: Emails notifications with AWS SES not working due to missing "from:" field

Posted by GitBox <gi...@apache.org>.
zachliu commented on issue #17930:
URL: https://github.com/apache/airflow/issues/17930#issuecomment-931715547


   I was led here because of this warning message
   ```
   WARNING - /usr/local/lib/python3.8/site-packages/airflow/utils/email.py:102 PendingDeprecationWarning:
   Fetching SMTP credentials from configuration variables will be deprecated in a future release.
   Please set credentials using a connection instead.
   ```
   then i tried SES and had the same problem. i almost opened up a duplicated issue :joy_cat: 
   for now i just put credentials into a `smtp_default` connection but be careful: https://github.com/apache/airflow/issues/16468#issuecomment-931714174 
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #17930: Emails notifications with AWS SES not working due to missing "from:" field

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #17930:
URL: https://github.com/apache/airflow/issues/17930#issuecomment-909746284


   Go for it @ecerulm ! I think that's good step with straightening email configuration. It requires quite some polishing (I am sure we will find some things to fix as well while we will iterate on the docs on this one - happy to brainstorm then).


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org