Work around a bug in smtp lib

Fixes #50
This commit is contained in:
Reinhard Müller 2021-02-15 15:26:38 +01:00
parent 8439d94742
commit 41a14e17b9

View file

@ -112,6 +112,7 @@ def _smtp_converse(
if debug:
LOGGER.debug(msg=f'Trying {mx_record} ...')
with SMTP(timeout=smtp_timeout) as smtp:
smtp._host = mx_record # Workaround for bug in smtplib
smtp.set_debuglevel(debuglevel=2 if debug else False)
code, message = smtp.connect(host=mx_record)
if code >= 400: