Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfig/global.ini.php2
-rw-r--r--core/Mail/Transport.php8
-rw-r--r--plugins/CoreAdminHome/Controller.php5
3 files changed, 10 insertions, 5 deletions
diff --git a/config/global.ini.php b/config/global.ini.php
index 010d2cf764..71d3366e94 100755
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -995,7 +995,7 @@ host = ; SMTP server address
type = ; SMTP Auth type. By default: NONE. For example: LOGIN
username = ; SMTP username
password = ; SMTP password
-encryption = ; SMTP transport-layer encryption, either 'ssl', 'tls', or empty (i.e., none).
+encryption = ; SMTP transport-layer encryption, either 'none', 'ssl', 'tls', or empty (i.e., auto).
[proxy]
type = BASIC ; proxy type for outbound/outgoing connections; currently, only BASIC is supported
diff --git a/core/Mail/Transport.php b/core/Mail/Transport.php
index 7ac2fbf2e4..edf6b13755 100644
--- a/core/Mail/Transport.php
+++ b/core/Mail/Transport.php
@@ -107,7 +107,7 @@ class Transport
/**
* @return void
*/
- private function initSmtpTransport($phpMailer)
+ private function initSmtpTransport(PHPMailer $phpMailer)
{
$mailConfig = Config::getInstance()->mail;
@@ -133,7 +133,11 @@ class Transport
}
if (!empty($mailConfig['encryption'])) {
- $phpMailer->SMTPSecure = $mailConfig['encryption'];
+ if (strtolower($mailConfig['encryption']) === 'none') {
+ $phpMailer->SMTPAutoTLS = false; // force using no encryption
+ } else {
+ $phpMailer->SMTPSecure = $mailConfig['encryption'];
+ }
}
if (!empty($mailConfig['port'])) {
diff --git a/plugins/CoreAdminHome/Controller.php b/plugins/CoreAdminHome/Controller.php
index cc717e9c9f..caa70012b1 100644
--- a/plugins/CoreAdminHome/Controller.php
+++ b/plugins/CoreAdminHome/Controller.php
@@ -121,9 +121,10 @@ class Controller extends ControllerAdmin
'Cram-md5' => 'Cram-md5',
);
$view->mailEncryptions = array(
- '' => '',
+ '' => 'auto',
'ssl' => 'SSL',
- 'tls' => 'TLS'
+ 'tls' => 'TLS',
+ 'none' => 'none',
);
$mail = new Mail();
$view->mailHost = $mail->getMailHost();