Smtp : il there is a connection error, reset the connection socket to not send multiple packets to closed socket (and generate associated errors)
This commit is contained in:
@@ -106,6 +106,7 @@ class Smtp
|
|||||||
if ($errstr === "" && $php_errormsg !== "") {
|
if ($errstr === "" && $php_errormsg !== "") {
|
||||||
$errstr = $php_errormsg;
|
$errstr = $php_errormsg;
|
||||||
}
|
}
|
||||||
|
$this->smtpStream = null;
|
||||||
throw new \Exception(sprintf(dgettext(
|
throw new \Exception(sprintf(dgettext(
|
||||||
"domframework",
|
"domframework",
|
||||||
"Can't connect to SMTP server : %s"
|
"Can't connect to SMTP server : %s"
|
||||||
@@ -139,6 +140,7 @@ class Smtp
|
|||||||
) ===
|
) ===
|
||||||
false
|
false
|
||||||
) {
|
) {
|
||||||
|
$this->smtpStream = null;
|
||||||
throw new \Exception(sprintf(dgettext(
|
throw new \Exception(sprintf(dgettext(
|
||||||
"domframework",
|
"domframework",
|
||||||
"Can't activate STARTTLS %s"
|
"Can't activate STARTTLS %s"
|
||||||
@@ -148,6 +150,7 @@ class Smtp
|
|||||||
$this->debug("STARTTLS ACTIVATED\n");
|
$this->debug("STARTTLS ACTIVATED\n");
|
||||||
}
|
}
|
||||||
} elseif ($this->starttls === "encrypt") {
|
} elseif ($this->starttls === "encrypt") {
|
||||||
|
$this->smtpStream = null;
|
||||||
throw new \Exception(dgettext(
|
throw new \Exception(dgettext(
|
||||||
"domframework",
|
"domframework",
|
||||||
"Server doesn't supports STARTTLS"
|
"Server doesn't supports STARTTLS"
|
||||||
@@ -170,6 +173,7 @@ class Smtp
|
|||||||
$this->putLine("AUTH LOGIN " . base64_encode($this->user) . "\r\n");
|
$this->putLine("AUTH LOGIN " . base64_encode($this->user) . "\r\n");
|
||||||
$this->putLine(base64_encode($this->password) . "\r\n");
|
$this->putLine(base64_encode($this->password) . "\r\n");
|
||||||
} else {
|
} else {
|
||||||
|
$this->smtpStream = null;
|
||||||
throw new \Exception(
|
throw new \Exception(
|
||||||
dgettext(
|
dgettext(
|
||||||
"domframework",
|
"domframework",
|
||||||
|
|||||||
Reference in New Issue
Block a user