New submission from Lord Anton Hvornum: ``` 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. ---------- components: Library (Lib) messages: 289886 nosy: Lord Anton Hvornum priority: normal severity: normal status: open title: smtplib.py doesn't capitalize EHLO. versions: Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29860> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com