diff --git a/config/defaults.inc.php b/config/defaults.inc.php index 5fc3c0229..4a872d7b8 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -323,11 +323,11 @@ $config['smtp_timeout'] = 0; // The example below enables server certificate validation, and // requires 'smtp_timeout' to be non zero. // $config['smtp_conn_options'] = [ -// 'ssl' => [ -// 'verify_peer' => true, -// 'verify_depth' => 3, -// 'cafile' => '/etc/openssl/certs/ca.crt', -// ], +// 'ssl' => [ +// 'verify_peer' => true, +// 'verify_depth' => 3, +// 'cafile' => '/etc/openssl/certs/ca.crt', +// ], // ]; // Note: These can be also specified as an array of options indexed by hostname $config['smtp_conn_options'] = null; diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index ab685a054..6468a00b2 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -1054,7 +1054,8 @@ class rcube_imap_generic } if (!empty($this->prefs['socket_options'])) { - $context = stream_context_create($this->prefs['socket_options']); + $options = array_intersect_key($this->prefs['socket_options'], ['ssl' => 1]); + $context = stream_context_create($options); $this->fp = stream_socket_client($host . ':' . $port, $errno, $errstr, $this->prefs['timeout'], STREAM_CLIENT_CONNECT, $context); }