From 0989a8bb8a99fc20445b28370d1b0a64cbaf0c85 Mon Sep 17 00:00:00 2001 From: Sean Whalen Date: Wed, 19 Sep 2018 08:01:30 -0400 Subject: [PATCH] Fix `SMTP AUTH extension not supported by server` error on some SMTP servers Issue #12 --- CHANGELOG.md | 2 ++ parsedmarc/__init__.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a5c94..1572cf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ GeoIP DB to avoid being blocked by security proxies - Add alignment booleans to JSON output - Fix `.msg` parsing CLI exception when `msgconvert` is not found in the system path +- Fix `SMTP AUTH extension not supported by server` error on some SMTP servers +(#12) 3.9.7 ----- diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index 7438401..013c409 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -1438,9 +1438,11 @@ def email_results(results, host, mail_from, mail_to, port=0, starttls=True, ssl_context = ssl.create_default_context() if use_ssl: server = smtplib.SMTP_SSL(host, port=port, context=ssl_context) + server.connect(host, port) server.helo() else: server = smtplib.SMTP(host, port=port) + server.connect(host, port) server.ehlo() if starttls: server.starttls(context=ssl_context)