syrusakbary / validate_email

Validate_email verify if an email address is valid and really exists
Other
574 stars 232 forks source link

Returns none when using provider that blocks port 25 #61

Open jmdahling opened 7 years ago

jmdahling commented 7 years ago

This happens to any customers using xfinity for example - see: https://www.xfinity.com/support/internet/email-port-25-no-longer-supported/

Recommend that the script be updated to utilize port 587 to avoid additional bugs due to return of "None"

jmdahling commented 7 years ago

Here's how I tested and discovered this:

import smtplib smtp = smtplib.SMTP(timeout=5) smtp.connect('smtp.gmail.com') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/smtplib.py", line 316, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket return socket.create_connection((host, port), timeout) File "/usr/lib/python2.7/socket.py", line 575, in create_connection raise err socket.timeout: timed out smtp = smtplib.SMTP(port=587, timeout=5) smtp.connect('smtp.gmail.com') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/smtplib.py", line 316, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket return socket.create_connection((host, port), timeout) File "/usr/lib/python2.7/socket.py", line 575, in create_connection raise err socket.timeout: timed out smtp.connect('smtp.gmail.com', port=587) (220, 'smtp.gmail.com ESMTP o189sm28894377pga.12 - gsmtp')

jayvdb commented 7 years ago

smtplib.SMTP_SSL should be used first, and then smtplib.SMTP.

i2dcarrasco commented 5 years ago

Hello,

Is there any plan to fix this issue?. I've the same issue because some cloud providers block port 25 (like FCP for example), and then the script is unable to connect.

Thanks!

liamdn10 commented 5 years ago

I got the same Issue when using AWS lambda. So I contacted support and then they removed port 25 throttle. I think that was only way

njkevlani commented 5 years ago

Google Cloud also blocks outgoing traffic on port 25. Details here.