Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue22216

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:smtplip STARTTLS fails at second attampt due to unsufficiant quit()
Type:behaviorStage:resolved
Components:email, Library (Lib)Versions:Python 3.4, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: barry, r.david.murray, zvyn
Priority:normalKeywords:patch

Created on2014-08-17 16:53 byzvyn, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
quit_resets_greeting.patchzvyn,2014-08-17 16:53review
Messages (2)
msg225450 -(view)Author: Milan Oberkirch (zvyn)*Date: 2014-08-17 16:53
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.
msg226150 -(view)Author: R. David Murray (r.david.murray)*(Python committer)Date: 2014-08-30 20:59
Thanks, Milan.I could swear I typed a '6' in the commit message, but apparently not...New changeseta058760cb069 by R David Murray in branch '3.4':#22215: have the smtplib 'quit' command reset the state.http://hg.python.org/cpython/rev/a058760cb069New changesetd0d4ab0ba70e by R David Murray in branch 'default':Merge#22215: have the smtplib 'quit' command reset the state.http://hg.python.org/cpython/rev/d0d4ab0ba70eNew changeset7288519594de by R David Murray in branch '2.7':#22215: have the smtplib 'quit' command reset the state.http://hg.python.org/cpython/rev/7288519594de
History
DateUserActionArgs
2022-04-11 14:58:07adminsetgithub: 66412
2014-08-30 20:59:23r.david.murraysetstatus: open -> closed
resolution: fixed
messages: +msg226150

stage: resolved
2014-08-19 06:28:50r.david.murraysetnosy: +barry,r.david.murray
components: + email
2014-08-17 16:53:45zvyncreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp