Message 76640 - Python tracker (original) (raw)
The enclosed patch does three things:
- enables SMTP_SSL working: the _get_socket method was setting self.sock instead of returning the socket to the caller, which did reset self.sock to None
- replace home-grown SSLFakeFile() with calls to ssl.socket's makefile() calls both in the starttls and in the SMTP_SSL cases
- shutdown sockets before closing them, to avoid server-side piling and connection refused on connection-limited servers The last change is just a cosmetical refactoring, but it really helps the SMTP_SSL case: default_port should really be a class attribute, instead of being set at init time.