From 6acbf2f8dcd0138d740b7203c03a3b5c5a241efe Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Mon, 27 Apr 2020 23:08:34 +0200 Subject: [PATCH] do not accept email without MX record --- app/email_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/email_utils.py b/app/email_utils.py index 0ef29c44..75b54994 100644 --- a/app/email_utils.py +++ b/app/email_utils.py @@ -328,6 +328,11 @@ def can_be_used_as_personal_email(email: str) -> bool: # check if email MX domain is disposable mx_domains = get_mx_domain_list(domain) + + # if no MX record, email is not valid + if not mx_domains: + return False + for mx_domain in mx_domains: if is_disposable_domain(mx_domain): LOG.d("MX Domain %s %s is disposable", mx_domain, domain)