You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/03/08 01:48:54 UTC

[GitHub] [airflow] hussein-awala opened a new pull request, #29968: [WIP] Creating SMTP provider

hussein-awala opened a new pull request, #29968:
URL: https://github.com/apache/airflow/pull/29968

   closes: #28494 
   
   ---
   This PR creates a new provider SMTP to manage the connections, hooks and operators related to SMTP/email sending.


-- 
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 merged pull request #29968: Creating SMTP provider

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #29968:
URL: https://github.com/apache/airflow/pull/29968


-- 
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] eladkal commented on a diff in pull request #29968: [WIP] Creating SMTP provider

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on code in PR #29968:
URL: https://github.com/apache/airflow/pull/29968#discussion_r1134041813


##########
airflow/providers/smtp/CHANGELOG.rst:
##########
@@ -0,0 +1,25 @@
+ .. Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+ ..   http://www.apache.org/licenses/LICENSE-2.0
+
+ .. Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+
+.. NOTE TO CONTRIBUTORS:
+   Please, only add notes to the Changelog just below the "Changelog" header when there are some breaking changes
+   and you want to add an explanation to the users on how they are supposed to deal with them.
+   The changelog is updated and maintained semi-automatically by release manager.
+
+Changelog
+---------

Review Comment:
   ```suggestion
   Changelog
   ---------
   
   1.0.0
   .....
   
   Initial version of the provider.
   ```
   
   This should be fine now



##########
docs/apache-airflow-providers-smtp/connections/smtp.rst:
##########
@@ -0,0 +1,80 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+ ..   http://www.apache.org/licenses/LICENSE-2.0
+
+ .. Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+
+
+.. _howto/connection:smtp:
+
+SMTP Connection
+===============
+
+The SMTP connection type enables integrations with the SMTP client.
+
+Authenticating to SMTP
+----------------------
+
+Authenticate to the SMTP client with the login and password field.
+Use standard `SMTP authentication
+<https://docs.python.org/3/library/smtplib.html>`_
+
+Default Connection IDs
+----------------------
+
+Hooks, operators, and sensors related to SMTP use ``smtp_default`` by default.
+
+Configuring the Connection
+--------------------------
+
+Login
+    Specify the username used for the SMTP client.
+
+Password
+    Specify the password used for the SMTP client.
+
+Host
+    Specify the SMTP host url.
+
+Port
+    Specify the SMTP port to connect to. The default depends on the whether you use ssl or not.
+
+Extra (optional)
+    Specify the extra parameters (as json dictionary)
+
+    * ``from_email``: The email address from which you want to send the email.
+    * ``disable_ssl``: If set to true, then a non-ssl connection is being used. Default is false. Also note that changing the ssl option also influences the default port being used.

Review Comment:
   Not mandatory but would be nice to have it as boolean field in the UI



##########
airflow/providers/smtp/provider.yaml:
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+---
+package-name: apache-airflow-providers-smtp
+name: Simple Mail Transfer Protocol (SMTP)
+
+description: |
+  `Simple Mail Transfer Protocol (SMTP) <https://tools.ietf.org/html/rfc5321>`__
+
+versions:
+  - 1.0.0
+
+dependencies: []

Review Comment:
   We need minimum Airflow 2.3.0 version (as we have for all providers)



-- 
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] hussein-awala commented on pull request #29968: [WIP] Creating SMTP provider

Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on PR #29968:
URL: https://github.com/apache/airflow/pull/29968#issuecomment-1464737698

   > I think this provider will also need to be added to the pre installed ones
   
   @eladkal I cannot add before releasing the provider, where the Airflow setup uses PyPI package and not local one, so as I mentioned in the description, I will create a new PR to do that once the provider is released.


-- 
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 pull request #29968: Creating SMTP provider

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #29968:
URL: https://github.com/apache/airflow/pull/29968#issuecomment-1468904858

   Nice one @hussein-awala !


-- 
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] eladkal commented on pull request #29968: [WIP] Creating SMTP provider

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on PR #29968:
URL: https://github.com/apache/airflow/pull/29968#issuecomment-1464736593

   I think this provider will also need to be added to the pre installed ones:
   https://github.com/apache/airflow/blob/275ef6cca58d9628ce1ffaeba4a416fd4a1073e6/setup.py#L690-L699
   
   This is because currently the ability to send email is coupled with core and assuming we will deprecate the core operator in favor of the provider one we need the provider to be installed with Airflow.


-- 
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] hussein-awala commented on a diff in pull request #29968: [WIP] Creating SMTP provider

Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on code in PR #29968:
URL: https://github.com/apache/airflow/pull/29968#discussion_r1134585649


##########
docs/apache-airflow-providers-smtp/connections/smtp.rst:
##########
@@ -0,0 +1,80 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+ ..   http://www.apache.org/licenses/LICENSE-2.0
+
+ .. Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+
+
+.. _howto/connection:smtp:
+
+SMTP Connection
+===============
+
+The SMTP connection type enables integrations with the SMTP client.
+
+Authenticating to SMTP
+----------------------
+
+Authenticate to the SMTP client with the login and password field.
+Use standard `SMTP authentication
+<https://docs.python.org/3/library/smtplib.html>`_
+
+Default Connection IDs
+----------------------
+
+Hooks, operators, and sensors related to SMTP use ``smtp_default`` by default.
+
+Configuring the Connection
+--------------------------
+
+Login
+    Specify the username used for the SMTP client.
+
+Password
+    Specify the password used for the SMTP client.
+
+Host
+    Specify the SMTP host url.
+
+Port
+    Specify the SMTP port to connect to. The default depends on the whether you use ssl or not.
+
+Extra (optional)
+    Specify the extra parameters (as json dictionary)
+
+    * ``from_email``: The email address from which you want to send the email.
+    * ``disable_ssl``: If set to true, then a non-ssl connection is being used. Default is false. Also note that changing the ssl option also influences the default port being used.

Review Comment:
   I already added it ([line](https://github.com/apache/airflow/pull/29968/files#diff-263bb81fd2d2743284a2b74545d6764328eb662a09f97ccc13a1126e0f99d8b5R137))



-- 
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