Work around a bug in smtp lib #52

Merged
reinhard-mueller merged 1 commit from master into master 2021-02-15 16:42:50 +01:00

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: