Can't close SMTP connection, when already disconnected.
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.
Change History
(6)
Needs tests: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Type: |
Uncategorized → Cleanup/optimization
|
Cc: |
hongshuning@… added
|
Easy pickings: |
set
|
Needs tests: |
unset
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Thanks for the report. It would be nice to have a test for this. It's always a bit heary to simulate SMTP connections in the test suite, but I've been able to reproduce it with: