smtplib and TLS

Matthias Kluwe mkluwe at gmail.com
Sat Jun 18 09:32:58 CEST 2005


> "Matthias Kluwe" <mkl... at gmail.com> writes:
>> The server accepts and delivers my messages, but the last command
>> raises

>> socket.sslerror: (8, 'EOF occurred in violation of protocol')

>> Did I miss something? Any hint is welcome.

> Looks like the module didn't send an TLS Close Notify message before
> closing the socket.  I don't see anything in the docs about how to
> send one from smtplib or socket, though.

Hmm. I tried

server.sock.realsock.shutdown(2)

before server.quit() with the result of

SMTPServerDisconnected('Server not connected')

being raised. Quite an improvement ...

Matthias




More information about the Python-list mailing list