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 Aug 27, 2024
1 parent 25707d6 commit af3bc1e
Show file tree
Hide file tree
Showing 2 changed files with 8 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 @@ -1497,9 +1497,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
5 changes: 4 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 @@ -409,7 +412,7 @@ function authenticate($username, $password, $mech) {
}
}

if (!$result) {
if (!isset($result)) {
$result = 'An error occurred authenticating to the SMTP server';
$res = $this->get_response();
if ($this->compare_response($res, '235') == 0) {
Expand Down

0 comments on commit af3bc1e

Please sign in to comment.