[issue1339] smtplib starttls() should ehlo() if it needs to

James Henstridge report at bugs.python.org
Sat Jan 12 14:46:42 CET 2008


James Henstridge added the comment:

>From RFC 2487 section 5.2: "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. The client
SHOULD send an EHLO command as the first command after a successful TLS
negotiation."

So the starttls() method should probably also be clearing helo_resp and
ehlo_resp (and maybe anything else discovered by ehlo()).

There are servers in the wild that will (a) refuse to talk to you unless
you issue another EHLO after TLS is negotiated and (b) offer a different
set of ESMTP features (such as only supporting SMTP AUTH after TLS). 
This patch isn't enough to talk to such servers.

----------
nosy: +jamesh

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1339>
__________________________________


More information about the Python-bugs-list mailing list