Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion validate_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ def validate_email(email, check_mx=False, verify=False, debug=False, smtp_timeou
mx_hosts = get_mx_ip(hostname)
if mx_hosts is None:
return False
if not verify:
return True
for mx in mx_hosts:
try:
if not verify and mx[1] in MX_CHECK_CACHE:
if mx[1] in MX_CHECK_CACHE:
return MX_CHECK_CACHE[mx[1]]
smtp = smtplib.SMTP(timeout=smtp_timeout)
smtp.connect(mx[1])
Expand Down