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 zvyn
Recipients zvyn
Date 2014-08-17.16:53:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1408294425.22.0.0722430877114.issue22216@psf.upfronthosting.co.za>
In-reply-to
Content
When using smtplib.SMTP to connect to a SMTP server the instance variables esmtp_response survives a SMTP.quit() which results in the following error:

>>> import smtplib
>>> smtp = smtplib.SMTP('mail.oberkirch.org', 25)
>>> smtp.starttls()
(220, b'2.0.0 Ready to start TLS')
>>> smtp.ehlo()
(250, b'mail.oberkirch.org\nPIPELINING\nSIZE 10240000\nVRFY\nETRN\nAUTH PLAIN LOGIN\nAUTH=PLAIN LOGIN\nENHANCEDSTATUSCODES\n8BITMIME\nDSN')
>>> smtp.quit()
(221, b'2.0.0 Bye')
>>> smtp.connect('mail.oberkirch.org', 25)
(220, b'mail.oberkirch.org ESMTP Postfix')
>>> smtp.starttls()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/smtplib.py", line 672, in starttls
    raise SMTPException("STARTTLS extension not supported by server.")
smtplib.SMTPException: STARTTLS extension not supported by server.
>>>

While reporting this issue I found out that starttls also does not throw away any ehlo information as it should. Provided that fixing this would probably break existing code (which would only work with non-standard servers like postfix) I did not change that behaviour.
History
Date User Action Args
2014-08-17 16:53:45zvynsetrecipients: + zvyn
2014-08-17 16:53:45zvynsetmessageid: <1408294425.22.0.0722430877114.issue22216@psf.upfronthosting.co.za>
2014-08-17 16:53:45zvynlinkissue22216 messages
2014-08-17 16:53:44zvyncreate