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

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Mokris <smokris@softpixel.com>2022-08-15 10:39:06 +0300
committerGitHub <noreply@github.com>2022-08-15 10:39:06 +0300
commit879d456b301893ba3d8a4e450dcde945f68f8bcf (patch)
tree4362cdac7750b4ce1fd8a88c1ac1c55eba4df030
parentcdb98e45013980d91c90f7d67b96de02972b405b (diff)
Restore support for ManageSieve over implicit SSL. (#8670)
-rw-r--r--plugins/managesieve/config.inc.php.dist3
-rw-r--r--plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php6
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/managesieve/config.inc.php.dist b/plugins/managesieve/config.inc.php.dist
index 354709586..28029e3b1 100644
--- a/plugins/managesieve/config.inc.php.dist
+++ b/plugins/managesieve/config.inc.php.dist
@@ -8,7 +8,8 @@
// For example %n = mail.domain.tld, %d = domain.tld
// If port is omitted it will be determined automatically using getservbyname()
// function, with 4190 as a fallback.
-// Note: Add tls:// prefix to enable TLS
+// Note: Add tls:// prefix to enable explicit STARTTLS
+// or add ssl:// prefix to enable implicit SSL.
$config['managesieve_host'] = 'localhost';
// authentication method. Can be CRAM-MD5, DIGEST-MD5, PLAIN, LOGIN, EXTERNAL
diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
index ce6bc384c..a09f456e6 100644
--- a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
+++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
@@ -184,8 +184,14 @@ class rcube_sieve_engine
list($host, $scheme, $port) = rcube_utils::parse_host_uri($plugin['host']);
+ // Support explicit STARTTLS by establishing an unencrypted TCP connection, then instructing Net_Sieve to send the `STARTTLS` command.
$tls = $scheme === 'tls';
+ // Support implicit SSL by passing the URI scheme through to Net_Sieve -> Net_Socket -> stream_socket_client().
+ if ($scheme === 'ssl') {
+ $host = 'ssl://' . $host;
+ }
+
if (empty($port)) {
$port = getservbyname('sieve', 'tcp') ?: self::PORT;
}