Closed tyranron closed 1 year ago
Since merge of #57 connection setup is not part of the library. Connection failures will result in read/write errors.
It's generally not possible to determine if TCP connection is still established without trying to use it.
Revelead from https://github.com/amaurymartiny/check-if-email-exists/issues/794
Preamble
Some SMTP servers (like
gmx.com
andukr.net
, for example) automatically close connection if some SMTP error appears.We can check this easily via
telnet
:Bug description
In such situations
SmtpClient
doesn't report about a connection being closed neither withError::Client("Connection closed")
, nor withSmtpClient::is_connected()
.But, instead, any next command fails with the
io: incomplete
error.Expected behaviour
If SMTP connection is closed automatically by the foreign server, the
SmtpClient::is_connected()
method should reflect that and subsequent commands should fail witn anError::Client("Connection closed")
, but notio: incomplete
.Steps to reproduce
Paste this program to
examples/
directory:And run it: