From e6dee3a5b052cca12b98dc63dc102cb84520ad3a Mon Sep 17 00:00:00 2001 From: Hemna Date: Sun, 10 Jan 2021 13:22:23 -0500 Subject: [PATCH] Disable MX record validation This patch disables the MX record checking for email address shortcuts. verizon is a shit smtp host that won't let you check emails as existing/valid. Email validation still is checked against RFC based regex for email address as well as blacklist checking. TODO(hemna): make this optionally enabled by config file. --- aprsd/email.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aprsd/email.py b/aprsd/email.py index ed562e8..de8f8b8 100644 --- a/aprsd/email.py +++ b/aprsd/email.py @@ -88,15 +88,16 @@ def validate_shortcuts(config): ) delete_keys = [] for key in shortcuts: + LOG.info("Validating {}:{}".format(key, shortcuts[key])) is_valid = validate_email( email_address=shortcuts[key], check_regex=True, - check_mx=True, + check_mx=False, from_address=config["smtp"]["login"], helo_host=config["smtp"]["host"], smtp_timeout=10, dns_timeout=10, - use_blacklist=False, + use_blacklist=True, debug=False, ) if not is_valid: