summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-01-17 07:54:47 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-01-17 07:54:47 (GMT)
commit0f99b71bd06d5916e1865c7f11f1d4e3fb266034 (patch)
tree3dac74f0d65f57942c3c6ed63a4a652ef19f1055 /Lib/smtplib.py
parentf43a86b9d784acac33a87e1e0695f2abf28047a2 (diff)
downloadcpython-0f99b71bd06d5916e1865c7f11f1d4e3fb266034.zip
cpython-0f99b71bd06d5916e1865c7f11f1d4e3fb266034.tar.gz
cpython-0f99b71bd06d5916e1865c7f11f1d4e3fb266034.tar.bz2
** backport r60015 from trunk.
- Issue829951: In the smtplib module, SMTP.starttls() now complies with RFC 3207 and forgets any knowledge obtained from the server not obtained from the TLS negotiation itself. Patch contributed by Bill Fenner.
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-xLib/smtplib.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 9c8c4fa..1b9739c 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -605,6 +605,14 @@ class SMTP:
sslobj = socket.ssl(self.sock, keyfile, certfile)
self.sock = SSLFakeSocket(self.sock, sslobj)
self.file = SSLFakeFile(sslobj)
+ # RFC 3207:
+ # The client MUST discard any knowledge obtained from
+ # the server, such as the list of SMTP service extensions,
+ # which was not obtained from the TLS negotiation itself.
+ self.helo_resp = None
+ self.ehlo_resp = None
+ self.esmtp_features = {}
+ self.does_esmtp = 0
return (resp, reply)
def sendmail(self, from_addr, to_addrs, msg, mail_options=[],