Vergleich inc/mailhandlers/smtp.php - 1.8.17 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 247Zeile 247
				return false;
}


				return false;
}


			$this->send_data('.', 250);




			if(!$this->send_data('.', 250))
{
$this->fatal_error("Mail may not be delivered. Reason: ".$this->get_error());
}


if(!$this->keep_alive)
{


if(!$this->keep_alive)
{

Zeile 271Zeile 274
		global $lang, $mybb;

$this->connection = @fsockopen($this->host, $this->port, $error_number, $error_string, $this->timeout);

		global $lang, $mybb;

$this->connection = @fsockopen($this->host, $this->port, $error_number, $error_string, $this->timeout);





		// DIRECTORY_SEPARATOR checks if running windows

		// DIRECTORY_SEPARATOR checks if running windows

		if(function_exists('stream_set_timeout') && DIRECTORY_SEPARATOR != '\\')

		if(is_resource($this->connection) && function_exists('stream_set_timeout') && DIRECTORY_SEPARATOR != '\\')

		{
@stream_set_timeout($this->connection, $this->timeout, 0);
}

		{
@stream_set_timeout($this->connection, $this->timeout, 0);
}

Zeile 285Zeile 288
			if(!$this->check_status('220'))
{
$this->fatal_error("The mail server is not ready, it did not respond with a 220 status message.");

			if(!$this->check_status('220'))
{
$this->fatal_error("The mail server is not ready, it did not respond with a 220 status message.");

				return false;
}


				return false;
}


			if($this->use_tls || (!empty($this->username) && !empty($this->password)))

			if($this->use_tls || (!empty($this->username) && !empty($this->password)))

			{

			{

				$helo = 'EHLO';
}
else
{
$helo = 'HELO';

				$helo = 'EHLO';
}
else
{
$helo = 'HELO';

			}

			}


$data = $this->send_data("{$helo} {$this->helo}", 250);
if(!$data)


$data = $this->send_data("{$helo} {$this->helo}", 250);
if(!$data)

Zeile 303Zeile 306
				$this->fatal_error("The server did not understand the {$helo} command");
return false;
}

				$this->fatal_error("The server did not understand the {$helo} command");
return false;
}





			if($this->use_tls && preg_match("#250( |-)STARTTLS#mi", $data))
{
if(!$this->send_data('STARTTLS', 220))

			if($this->use_tls && preg_match("#250( |-)STARTTLS#mi", $data))
{
if(!$this->send_data('STARTTLS', 220))

				{

				{

					$this->fatal_error("The server did not understand the STARTTLS command. Reason: ".$this->get_error());
return false;
}

					$this->fatal_error("The server did not understand the STARTTLS command. Reason: ".$this->get_error());
return false;
}

				if(!@stream_socket_enable_crypto($this->connection, true, STREAM_CRYPTO_METHOD_TLS_CLIENT))











$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
// Fix for PHP >=5.6.7 and <7.2 not including TLS 1.1 and 1.2
if(defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT'))
{
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}

if(!@stream_socket_enable_crypto($this->connection, true, $crypto_method))

				{
$this->fatal_error("Failed to start TLS encryption");
return false;

				{
$this->fatal_error("Failed to start TLS encryption");
return false;