Skip to content

Commit

Permalink
Correct sieve connection when using scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadow243 committed Oct 18, 2024
1 parent 296b44d commit 18c2c4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions modules/imap/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}}

Expand Down
4 changes: 3 additions & 1 deletion modules/smtp/hm-smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 18c2c4a

Please sign in to comment.