cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks and SMTP

746837
New Contributor II

Using databricks as aws partner trying to run python script to validate email addresses.  Whenever it gets to the smtp portion it times out.  I am able to telnet from python to the POP servers and get a response, I can ping domains and get replies, but when trying to telnet to port 25 or 587 of smtp it times out after 15 minutes if there is no timeout set. The security groups all have outbound rules to allow all traffic to destination 0.0.0.0/0 so I'm trying to find out why smtp ports time out only.  Any insights if someone has come across this would be greatly appreciated.

2 REPLIES 2

Atanu
Esteemed Contributor
Esteemed Contributor

When you say timing out, what is the error you are seeing in databricks side?

746837
New Contributor II
TimeoutError                              Traceback (most recent call last)
File <command-3312150305305279>, line 2
      1 email = 'geraldgleason@outlook.com'
----> 2 check_email(email)

File <command-3312150305305278>, line 19, in check_email(email)
     17 with smtplib.SMTP() as smtp:
     18   try:
---> 19       smtp.connect(mx_records[0].exchange.to_text())
     20       code, _ = smtp.helo()
     21       if code != 250:

File /usr/lib/python3.10/smtplib.py:341, in SMTP.connect(self, host, port, source_address)
    339     port = self.default_port
    340 sys.audit("smtplib.connect", self, host, port)
--> 341 self.sock = self._get_socket(host, port, self.timeout)
    342 self.file = None
    343 (code, msg) = self.getreply()
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.