This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Lord Anton Hvornum
Recipients Lord Anton Hvornum
Date 2017-03-20.14:32:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490020373.29.0.308540627587.issue29860@psf.upfronthosting.co.za>
In-reply-to
Content
```
  File "mail.py", line 9, in <module>
    smtp_server.starttls(context)
  File "/usr/lib/python3.6/smtplib.py", line 748, in starttls
    self.ehlo_or_helo_if_needed()
  File "/usr/lib/python3.6/smtplib.py", line 600, in ehlo_or_helo_if_needed
    (code, resp) = self.helo()
  File "/usr/lib/python3.6/smtplib.py", line 429, in helo
    (code, msg) = self.getreply()
  File "/usr/lib/python3.6/smtplib.py", line 393, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")
```

This happens due to the server expecting commands (like EHLO, STARTTLS) being strict upper-case. And when the SMTP command isn't, it drops us.

This is a rare edge case since most mail servers handles shady client data in numerous different ways (such as gmail never sending QUIT for instance).

I don't know of a work-around for this and the documentation states `EHLO` is being sent (https://docs.python.org/3/library/smtplib.html), so I guess the lib assumes that's the case as well.
History
Date User Action Args
2017-03-20 14:32:53Lord Anton Hvornumsetrecipients: + Lord Anton Hvornum
2017-03-20 14:32:53Lord Anton Hvornumsetmessageid: <1490020373.29.0.308540627587.issue29860@psf.upfronthosting.co.za>
2017-03-20 14:32:53Lord Anton Hvornumlinkissue29860 messages
2017-03-20 14:32:53Lord Anton Hvornumcreate