summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-01-21 13:12:06 +0100
committerAleksander Machniak <alec@alec.pl>2014-01-21 13:12:06 +0100
commit357f9c831a7b1d01a6f7dfd40f44f77acde15a54 (patch)
tree5f6ca53a2b2f342754170adfb0f69eced6e5a164
parentbc0afad1b3180c1e8a60a4cc53360db2f5078356 (diff)
Support SMTP socket context options via new config option 'smtp_conn_options'
-rw-r--r--CHANGELOG1
-rw-r--r--config/defaults.inc.php13
-rw-r--r--program/lib/Roundcube/rcube_smtp.php3
3 files changed, 16 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 6beb463d7..b8c823714 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Support SMTP socket context options via new config option 'smtp_conn_options'
- Fix compatibility with PHP 5.2 in html.php file (#1489514)
- Remove expand/collapse with plus/minus keys (on numeric keypad) (#1489513)
- Fix issue where filesystem path was added to all-attachments (zip) file (#1489507)
diff --git a/config/defaults.inc.php b/config/defaults.inc.php
index b1e3bc85e..8c9b96f1a 100644
--- a/config/defaults.inc.php
+++ b/config/defaults.inc.php
@@ -235,6 +235,19 @@ $config['smtp_helo_host'] = '';
// timeout > 0 causes connection errors (https://bugs.php.net/bug.php?id=54511)
$config['smtp_timeout'] = 0;
+// SMTP socket context options
+// See http://php.net/manual/en/context.ssl.php
+// The example below enables server certificate validation, and
+// requires 'smtp_timeout' to be non zero.
+// $config['smtp_conn_options'] = array(
+// 'ssl' => array(
+// 'verify_peer' => true,
+// 'verify_depth => 3,
+// 'cafile' => '/etc/openssl/certs/ca.crt',
+// ),
+// );
+$config['smtp_conn_options'] = null;
+
// ----------------------------------
// LDAP
// ----------------------------------
diff --git a/program/lib/Roundcube/rcube_smtp.php b/program/lib/Roundcube/rcube_smtp.php
index 60b1389ea..5f1200b38 100644
--- a/program/lib/Roundcube/rcube_smtp.php
+++ b/program/lib/Roundcube/rcube_smtp.php
@@ -67,6 +67,7 @@ class rcube_smtp
'smtp_auth_type' => $rcube->config->get('smtp_auth_type'),
'smtp_helo_host' => $rcube->config->get('smtp_helo_host'),
'smtp_timeout' => $rcube->config->get('smtp_timeout'),
+ 'smtp_conn_options' => $rcube->config->get('smtp_conn_options'),
'smtp_auth_callbacks' => array(),
));
@@ -106,7 +107,7 @@ class rcube_smtp
// IDNA Support
$smtp_host = rcube_utils::idn_to_ascii($smtp_host);
- $this->conn = new Net_SMTP($smtp_host, $smtp_port, $helo_host);
+ $this->conn = new Net_SMTP($smtp_host, $smtp_port, $helo_host, false, 0, $CONFIG['smtp_conn_options']);
if ($rcube->config->get('smtp_debug')) {
$this->conn->setDebug(true, array($this, 'debug_handler'));