From 18c2c4a79eab244a47d032efc28dea8ecc1dad33 Mon Sep 17 00:00:00 2001 From: Steven Ngesera Date: Tue, 27 Aug 2024 05:43:07 +0300 Subject: [PATCH] Correct sieve connection when using scheme --- modules/imap/functions.php | 6 ++++-- modules/smtp/hm-smtp.php | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/imap/functions.php b/modules/imap/functions.php index 3dd58c16b6..96bc11c707 100644 --- a/modules/imap/functions.php +++ b/modules/imap/functions.php @@ -1518,9 +1518,11 @@ function parse_sieve_config_host($host) { $url = parse_url($host); $host = $url['host'] ?? $url['path']; $port = $url['port'] ?? '4190'; - $scheme = $url['scheme'] ?? 'tcp://'; + $scheme = $url['scheme'] ?? ''; $tls = $scheme === 'tls'; - // $host = '$scheme://'.$host; + if (!empty($scheme)) { + $host = $scheme . '://' . $host; + } return [$host, $port, $tls]; }} diff --git a/modules/smtp/hm-smtp.php b/modules/smtp/hm-smtp.php index b692449eba..40d78ab298 100644 --- a/modules/smtp/hm-smtp.php +++ b/modules/smtp/hm-smtp.php @@ -60,6 +60,9 @@ class Hm_SMTP { private $config; private $server; private $starttls; + private $supports_tls; + private $supports_auth; + private $max_message_size; private $port; private $tls; private $auth; @@ -411,7 +414,6 @@ function authenticate($username, $password, $mech) { break; } } - if (!isset($result)) { $result = 'An error occurred authenticating to the SMTP server'; $res = $this->get_response();