Automatic STARTTLS support detection
Closed this issue · 3 comments
mishaturnbull commented
EmailSender._launch().connect()
hangs on a server that does not require TLS or login authentication.
mishaturnbull commented
I believe this was closed in c8e77eb. Need to confirm.
mishaturnbull commented
Was technically not closed. Issue remains -- c877eb only fixed the issue for a local Mercury server. Mercury, by default, does not require nor allow SSL/TLS connections therefore hangs on a STARTTLS
smtp command. THAT particular issue was fixed; but not the more general case for non-authenticated servers.
mishaturnbull commented
Discovered that Python's smtplib.SMTP
class has a .has_extn(...)
method, which can be used like:
if server.has_extn("STARTTLS"):
server.starttls()