feluelle commented on a change in pull request #20441:
URL: https://github.com/apache/airflow/pull/20441#discussion_r781815161
##########
File path: airflow/providers/imap/hooks/imap.py
##########
@@ -71,10 +71,11 @@ def get_conn(self) -> 'ImapHook':
"""
if not self.mail_client:
conn = self.get_connection(self.imap_conn_id)
- if conn.port:
- self.mail_client = imaplib.IMAP4_SSL(conn.host, conn.port)
- else:
- self.mail_client = imaplib.IMAP4_SSL(conn.host)
+
+ if conn.extra_dejson.get('use_ssl', True):
+ self.mail_client = imaplib.IMAP4_SSL(conn.host, conn.port or
imaplib.IMAP4_SSL_PORT)
+ else: # fallback to standard imap connection
+ self.mail_client = imaplib.IMAP4(conn.host, conn.port or
imaplib.IMAP4_PORT)
Review comment:
Oh didn't know that. Thank you for pointing out! :)
--
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]