Description

When the server has closed the SMTP connection (that happens rather quickly with most SMTP servers if you don't send any command for a few seconds), the exception SMTPServerDisconnected will be raised when trying to use the connection. That also happens when calling .quit(), like the SMTP backend does in its close() method.
So I have written a patch that catches SMTPServerDisconnected in addition to socket.sslerror, while closing the SMTP connection.