diff options
author | Steve Mokris <smokris@softpixel.com> | 2022-08-15 10:39:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-15 10:39:06 +0300 |
commit | 879d456b301893ba3d8a4e450dcde945f68f8bcf (patch) | |
tree | 4362cdac7750b4ce1fd8a88c1ac1c55eba4df030 | |
parent | cdb98e45013980d91c90f7d67b96de02972b405b (diff) |
Restore support for ManageSieve over implicit SSL. (#8670)
-rw-r--r-- | plugins/managesieve/config.inc.php.dist | 3 | ||||
-rw-r--r-- | plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php | 6 |
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; } |