From 75f37f8b0ffc2e418e3c82ba36c00729633ea35d Mon Sep 17 00:00:00 2001 From: urusha Date: Tue, 25 Sep 2018 06:31:08 +0000 Subject: [PATCH 01/13] SMTP GSSAPI support (#6417) * krb_authentication support for smtp_connect * smtp GSSAPI support --- .../krb_authentication/krb_authentication.php | 21 +++++++++++++++++++ program/lib/Roundcube/rcube_smtp.php | 5 +++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/plugins/krb_authentication/krb_authentication.php b/plugins/krb_authentication/krb_authentication.php index 66a3581ad..12ab95b51 100644 --- a/plugins/krb_authentication/krb_authentication.php +++ b/plugins/krb_authentication/krb_authentication.php @@ -25,6 +25,7 @@ class krb_authentication extends rcube_plugin $this->add_hook('login_after', array($this, 'login')); $this->add_hook('storage_connect', array($this, 'storage_connect')); $this->add_hook('managesieve_connect', array($this, 'managesieve_connect')); + $this->add_hook('smtp_connect', array($this, 'smtp_connect')); } /** @@ -127,4 +128,24 @@ class krb_authentication extends rcube_plugin return $args; } + + /** + * smtp_connect hook handler + */ + function smtp_connect($args) + { + if ((!isset($args['smtp_auth_type']) || $args['smtp_auth_type'] == 'GSSAPI') && !empty($_SERVER['REMOTE_USER']) && !empty($_SERVER['KRB5CCNAME'])) { + // Load plugin's config file + $this->load_config(); + + $rcmail = rcmail::get_instance(); + $context = $rcmail->config->get('krb_authentication_context'); + + $args['gssapi_context'] = $context ?: 'imap/kolab.example.org@EXAMPLE.ORG'; + $args['gssapi_cn'] = $_SERVER['KRB5CCNAME']; + $args['smtp_auth_type'] = 'GSSAPI'; + } + + return $args; + } } diff --git a/program/lib/Roundcube/rcube_smtp.php b/program/lib/Roundcube/rcube_smtp.php index 6be2510ea..cfa326b6f 100644 --- a/program/lib/Roundcube/rcube_smtp.php +++ b/program/lib/Roundcube/rcube_smtp.php @@ -108,7 +108,8 @@ 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, false, 0, $CONFIG['smtp_conn_options']); + $this->conn = new Net_SMTP($smtp_host, $smtp_port, $helo_host, false, 0, $CONFIG['smtp_conn_options'], + $CONFIG['gssapi_context'], $CONFIG['gssapi_cn']); if ($rcube->config->get('smtp_debug')) { $this->conn->setDebug(true, array($this, 'debug_handler')); @@ -154,7 +155,7 @@ class rcube_smtp } // attempt to authenticate to the SMTP server - if ($smtp_user && $smtp_pass) { + if (($smtp_user && $smtp_pass) || ($smtp_auth_type == 'GSSAPI')) { // IDNA Support if (strpos($smtp_user, '@')) { $smtp_user = rcube_utils::idn_to_ascii($smtp_user); From 255638cc441c3f472478d0a0fbfafc8bab9a1dc7 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 25 Sep 2018 08:33:08 +0200 Subject: [PATCH 02/13] Update changelog, require Net_SMTP 1.8.1 for GSSAPI support --- CHANGELOG | 1 + INSTALL | 2 +- composer.json-dist | 3 +-- program/lib/Roundcube/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 80543659b..bb0a5d178 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- SMTP GSSAPI support via krb_authentication plugin (#6417) - Removed referer_check option (#6440) - Update to TinyMCE 4.8.2 - Plugin API: Added 'raise_error' hook (#6199) diff --git a/INSTALL b/INSTALL index 9c62bbb14..d8ab5a127 100644 --- a/INSTALL +++ b/INSTALL @@ -19,7 +19,7 @@ REQUIREMENTS - GD, Imagick (optional thumbnails generation, QR-code) * PEAR and PEAR packages distributed with Roundcube or external: - Mail_Mime 1.10.0 or newer - - Net_SMTP 1.7.1 or newer + - Net_SMTP 1.8.1 or newer - Net_Socket 1.0.12 or newer - Net_IDNA2 0.1.1 or newer - Auth_SASL 1.0.6 or newer diff --git a/composer.json-dist b/composer.json-dist index 97d0f4abd..0ca230fb5 100644 --- a/composer.json-dist +++ b/composer.json-dist @@ -11,11 +11,10 @@ "require": { "php": ">=5.4.0", "pear/pear-core-minimal": "~1.10.1", - "pear/net_socket": "~1.2.1", "pear/auth_sasl": "~1.1.0", "pear/net_idna2": "~0.2.0", "pear/mail_mime": "~1.10.0", - "pear/net_smtp": "~1.8.0", + "pear/net_smtp": "~1.8.1", "pear/crypt_gpg": "~1.6.3", "pear/net_sieve": "~1.4.3", "roundcube/plugin-installer": "~0.1.6", diff --git a/program/lib/Roundcube/README.md b/program/lib/Roundcube/README.md index b5f5a51e9..1e028a3be 100644 --- a/program/lib/Roundcube/README.md +++ b/program/lib/Roundcube/README.md @@ -32,7 +32,7 @@ include_path directory of your webserver. Some classes of the framework require one or multiple of the following [PEAR][pear] libraries: - Mail_Mime 1.8.1 or newer -- Net_SMTP 1.7.1 or newer +- Net_SMTP 1.8.1 or newer - Net_Socket 1.0.12 or newer - Net_IDNA2 0.1.1 or newer - Auth_SASL 1.0.6 or newer From b2961742eff17e538fc0ab6738b9644ff79cb5c2 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 26 Sep 2018 10:53:02 +0200 Subject: [PATCH 03/13] Elastic: Support new-line char as a separator for pasted recipients (#6460) --- CHANGELOG | 1 + skins/elastic/ui.js | 39 ++++++++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index bb0a5d178..74fd70c5a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ CHANGELOG Roundcube Webmail - Password: Added 'modoboa' driver (#6361) - Password: Fix bug where password_dovecotpw_with_method setting could be ignored (#6436) - Password: Fix bug where new users could skip forced password change (#6434) +- Elastic: Support new-line char as a separator for pasted recipients (#6460) - Elastic: Improved UX of search dialogs (#6416) - Elastic: Fix unwanted thread expanding when selecting a collapsed thread in non-mobile mode (#6445) - Log errors caused by low pcre.backtrack_limit when sending a mail message (#6433) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 84abaf966..3ca049f99 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -2836,24 +2836,34 @@ function rcube_elastic_ui() else recipient.insertBefore(input.parent()); }, - update_func = function() { - var text = input.val().replace(/[,;\s]+$/, ''), - result = recipient_input_parser(text); + update_func = function(text) { + var result; + + text = (text || input.val()).replace(/[,;\s]+$/, ''); + result = recipient_input_parser(text); $.each(result.recipients, function() { insert_recipient(this.name, this.email); }); - input.val(result.text); - apply_func(); - input_len_update(); + // setTimeout() here is needed for proper input reset on paste event + setTimeout(function() { + input.val(result.text); + apply_func(); + input_len_update(); + }, 1); - if (result.recipients.length) { - return true; - } + return result.recipients.length > 0; }, parse_func = function(e) { - // Note it can be also executed when autocomplete inserts a recipient + // On paste the text is not yet in the input we have to use clipboard. + // Also because on paste new-line characters are replaced by spaces (#6460) + if (e.type == 'paste') { + update_func((e.originalEvent.clipboardData || window.clipboardData).getData('text')); + return; + } + + // Note: it can be also executed when autocomplete inserts a recipient update_func(); if (e.type == 'blur') { @@ -2867,8 +2877,8 @@ function rcube_elastic_ui() apply_func(); return false; } - // Here we add a recipient box when the separator character (,;) was pressed - else if (e.key == ',' || e.key == ';') { + // Here we add a recipient box when the separator (,;) or Enter was pressed + else if (e.key == ',' || e.key == ';' || e.key == 'Enter') { if (update_func()) { return false; } @@ -2877,7 +2887,7 @@ function rcube_elastic_ui() input_len_update(); }; - // Create the input elemennt and "editable" area + // Create the input element and "editable" area input = $('').attr({type: 'text', tabindex: $(obj).attr('tabindex')}) .on('paste change blur', parse_func) .on('keydown', keydown_func) @@ -2925,6 +2935,9 @@ function rcube_elastic_ui() */ function recipient_input_parser(text) { + // support new-line as a separator, for paste action (#6460) + text = $.trim(text.replace(/[,;\s]*[\r\n]+/g, ',')); + var recipients = [], address_rx_part = '(\\S+|("[^"]+"))@\\S+', recipient_rx1 = new RegExp('(<' + address_rx_part + '>)'), From c1e8bd75c2c19b4389ad2e9dc81b4cd03406527c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 27 Sep 2018 15:04:45 +0200 Subject: [PATCH 04/13] krb_authentication: Support per-protocol contexts --- plugins/krb_authentication/composer.json | 2 +- .../krb_authentication/config.inc.php.dist | 11 +++- .../krb_authentication/krb_authentication.php | 66 +++++++++---------- 3 files changed, 43 insertions(+), 36 deletions(-) diff --git a/plugins/krb_authentication/composer.json b/plugins/krb_authentication/composer.json index ee835556b..10af7eb35 100644 --- a/plugins/krb_authentication/composer.json +++ b/plugins/krb_authentication/composer.json @@ -3,7 +3,7 @@ "type": "roundcube-plugin", "description": "Kerberos Authentication", "license": "GPLv3+", - "version": "1.1", + "version": "1.2", "authors": [ { "name": "Jeroen van Meeuwen", diff --git a/plugins/krb_authentication/config.inc.php.dist b/plugins/krb_authentication/config.inc.php.dist index 63db16943..ae67f89a5 100644 --- a/plugins/krb_authentication/config.inc.php.dist +++ b/plugins/krb_authentication/config.inc.php.dist @@ -9,5 +9,12 @@ // Unlike $config['default_host'] this must be a string! $config['krb_authentication_host'] = ''; -// GSS API security context -$config['krb_authentication_context'] = 'imap/kolab.example.org@EXAMPLE.ORG'; +// GSS API security context. +// Single value or an array with per-protocol values. Example: +// +// $config['krb_authentication_context'] = array( +// 'imap' => 'imap/host.fqdn@REALM.NAME', +// 'smtp' => 'smtp/host.fqdn@REALM.NAME', +// 'sieve' => 'sieve/host.fqdn@REALM.NAME', +// ); +$config['krb_authentication_context'] = 'host.fqdn@REALM.NAME'; diff --git a/plugins/krb_authentication/krb_authentication.php b/plugins/krb_authentication/krb_authentication.php index 12ab95b51..95adc771d 100644 --- a/plugins/krb_authentication/krb_authentication.php +++ b/plugins/krb_authentication/krb_authentication.php @@ -76,34 +76,28 @@ class krb_authentication extends rcube_plugin } /** - * Storage_connect hook handler + * login_after hook handler */ - function storage_connect($args) + function login($args) { - if (!empty($_SERVER['REMOTE_USER']) && !empty($_SERVER['KRB5CCNAME'])) { - // Load plugin's config file - $this->load_config(); - - $rcmail = rcmail::get_instance(); - $context = $rcmail->config->get('krb_authentication_context'); - - $args['gssapi_context'] = $context ?: 'imap/kolab.example.org@EXAMPLE.ORG'; - $args['gssapi_cn'] = $_SERVER['KRB5CCNAME']; - $args['auth_type'] = 'GSSAPI'; + // Redirect to the previous QUERY_STRING + if ($this->redirect_query) { + header('Location: ./?' . $this->redirect_query); + exit; } return $args; } /** - * login_after hook handler + * Storage_connect hook handler */ - function login($args) + function storage_connect($args) { - // Redirect to the previous QUERY_STRING - if ($this->redirect_query) { - header('Location: ./?' . $this->redirect_query); - exit; + if (!empty($_SERVER['REMOTE_USER']) && !empty($_SERVER['KRB5CCNAME'])) { + $args['gssapi_context'] = $this->gssapi_context('imap'); + $args['gssapi_cn'] = $_SERVER['KRB5CCNAME']; + $args['auth_type'] = 'GSSAPI'; } return $args; @@ -115,37 +109,43 @@ class krb_authentication extends rcube_plugin function managesieve_connect($args) { if ((!isset($args['auth_type']) || $args['auth_type'] == 'GSSAPI') && !empty($_SERVER['REMOTE_USER']) && !empty($_SERVER['KRB5CCNAME'])) { - // Load plugin's config file - $this->load_config(); - - $rcmail = rcmail::get_instance(); - $context = $rcmail->config->get('krb_authentication_context'); - - $args['gssapi_context'] = $context ?: 'imap/kolab.example.org@EXAMPLE.ORG'; + $args['gssapi_context'] = $this->gssapi_context('sieve'); $args['gssapi_cn'] = $_SERVER['KRB5CCNAME']; $args['auth_type'] = 'GSSAPI'; } return $args; } - + /** * smtp_connect hook handler */ function smtp_connect($args) { if ((!isset($args['smtp_auth_type']) || $args['smtp_auth_type'] == 'GSSAPI') && !empty($_SERVER['REMOTE_USER']) && !empty($_SERVER['KRB5CCNAME'])) { - // Load plugin's config file - $this->load_config(); - - $rcmail = rcmail::get_instance(); - $context = $rcmail->config->get('krb_authentication_context'); - - $args['gssapi_context'] = $context ?: 'imap/kolab.example.org@EXAMPLE.ORG'; + $args['gssapi_context'] = $this->gssapi_context('smtp'); $args['gssapi_cn'] = $_SERVER['KRB5CCNAME']; $args['smtp_auth_type'] = 'GSSAPI'; } return $args; } + + /** + * Returns configured GSSAPI context string + */ + private function gssapi_context($protocol) + { + // Load plugin's config file + $this->load_config(); + + $rcmail = rcmail::get_instance(); + $context = $rcmail->config->get('krb_authentication_context'); + + if (is_array($context)) { + $context = $context[$protocol]; + } + + return $context ?: 'host.fqdn@REALM.NAME'; + } } From 0a0ac045fe30b5f07d24e62581b37adc8a7ac4c7 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 27 Sep 2018 16:00:54 +0200 Subject: [PATCH 05/13] Fix bug where valid content between HTML comments could have been skipped in some cases (#6464) --- CHANGELOG | 1 + program/lib/Roundcube/rcube_washtml.php | 11 ++++++++++- tests/Framework/Washtml.php | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 74fd70c5a..16fd00aaf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,7 @@ CHANGELOG Roundcube Webmail - Managesieve: Fix bug where show_real_foldernames setting wasn't respected (#6422) - New_user_identity: Fix %fu/%u vars substitution in user specific LDAP params (#6419) - Fix support for "allow-from " in "x_frame_options" config option (#6449) +- Fix bug where valid content between HTML comments could have been skipped in some cases (#6464) RELEASE 1.4-beta ---------------- diff --git a/program/lib/Roundcube/rcube_washtml.php b/program/lib/Roundcube/rcube_washtml.php index 8837a917f..497a1c3e4 100644 --- a/program/lib/Roundcube/rcube_washtml.php +++ b/program/lib/Roundcube/rcube_washtml.php @@ -643,6 +643,9 @@ class rcube_washtml $html = str_replace($badwordchars, $fixedwordchars, $html); + // FIXME: HTML comments handling could be better. The code below can break comments (#6464), + // we should probably do not modify content inside comments at all. + // fix (unknown/malformed) HTML tags before "wash" $html = preg_replace_callback('/(<(?!\!)[\/]*)([^\s>]+)([^>]*)/', array($this, 'html_tag_callback'), $html); @@ -665,9 +668,15 @@ class rcube_washtml */ public static function html_tag_callback($matches) { + // It might be an ending of a comment, ignore (#6464) + if (substr($matches[3], -2) == '--') { + $matches[0] = ''; + return implode('', $matches); + } + $tagname = $matches[2]; $tagname = preg_replace(array( - '/:.*$/', // Microsoft's Smart Tags + '/:.*$/', // Microsoft's Smart Tags '/[^a-z0-9_\[\]\!?-]/i', // forbidden characters ), '', $tagname); diff --git a/tests/Framework/Washtml.php b/tests/Framework/Washtml.php index 9879575a8..eebd80de5 100644 --- a/tests/Framework/Washtml.php +++ b/tests/Framework/Washtml.php @@ -98,6 +98,11 @@ class Framework_Washtml extends PHPUnit_Framework_TestCase $washed = $this->cleanupResult($washer->wash($html)); $this->assertEquals('

para1

para2

', $washed, "HTML comments - bracket inside"); + + $html = "

\n2\n4

"; + $washed = $this->cleanupResult($washer->wash($html)); + + $this->assertEquals("

\n2\n4

", $washed, "HTML comments (#6464)"); } /** From 91b5bffd3cfcb4f270f76620dac76d7849180f24 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 28 Sep 2018 10:24:54 +0200 Subject: [PATCH 06/13] Fix bug where autocomplete list could be displayed out of screen (#6469) --- CHANGELOG | 1 + program/js/app.js | 15 +++++++++++++-- skins/elastic/styles/widgets/dialogs.less | 17 ++++++++++------- skins/larry/styles.css | 2 ++ 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 16fd00aaf..e4d9e409d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ CHANGELOG Roundcube Webmail - Elastic: Improved UX of search dialogs (#6416) - Elastic: Fix unwanted thread expanding when selecting a collapsed thread in non-mobile mode (#6445) - Log errors caused by low pcre.backtrack_limit when sending a mail message (#6433) +- Fix bug where autocomplete list could be displayed out of screen (#6469) - Fix style/navigation on error page depending on authentication state (#6362) - Fix so invalid smtp_helo_host is never used, fallback to localhost (#6408) - Fix custom logo size in Elastic (#6424) diff --git a/program/js/app.js b/program/js/app.js index 2f0c3625f..fc22e0b7c 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -5941,9 +5941,20 @@ function rcube_webmail() // reset content ul.innerHTML = ''; this.env.contacts = []; + // move the results pane right under the input box - var pos = $(this.ksearch_input).offset(); - this.ksearch_pane.css({ left:pos.left+'px', top:(pos.top + this.ksearch_input.offsetHeight)+'px', display: 'none'}); + var pos = $(this.ksearch_input).offset(), + w = $(window).width(), + left = w - pos.left > 200 ? pos.left : w - 200, + width = Math.min(400, w - left); + + this.ksearch_pane.css({ + left: left + 'px', + top: (pos.top + this.ksearch_input.offsetHeight + 1) + 'px', + maxWidth: width + 'px', + minWidth: '200px', + display: 'none' + }); } // add each result line to list diff --git a/skins/elastic/styles/widgets/dialogs.less b/skins/elastic/styles/widgets/dialogs.less index f4d578a49..834d89a84 100644 --- a/skins/elastic/styles/widgets/dialogs.less +++ b/skins/elastic/styles/widgets/dialogs.less @@ -58,12 +58,20 @@ #rcmKSearchpane { width: auto; - max-width: none; - overflow: hidden; li { padding-right: .5rem; } + + html.layout-small &, + html.layout-phone & { + bottom: auto; + border: 1px solid @color-input-border; + } + + html.layout-phone & { + max-width: 100% !important; + } } html.layout-small, @@ -105,11 +113,6 @@ html.layout-phone { width: 100%; } - #rcmKSearchpane { - bottom: auto; - border: 1px solid @color-input-border; - } - .popover-header { display: block; border-radius: 0; diff --git a/skins/larry/styles.css b/skins/larry/styles.css index d073302ec..20ac1b33d 100644 --- a/skins/larry/styles.css +++ b/skins/larry/styles.css @@ -2426,6 +2426,8 @@ ul.toolbarmenu li span.copy { border: 0; cursor: default; position: relative; + overflow: hidden; + text-overflow: ellipsis; } #rcmKSearchpane ul li i.icon { From 8ab1e4fbc379d56b83f4c6d94c1f07f6024f0cf7 Mon Sep 17 00:00:00 2001 From: Stefanos Petrakis Date: Tue, 2 Oct 2018 16:29:18 +0200 Subject: [PATCH 07/13] Fix multiple VCard field search (#6466) --- program/lib/Roundcube/rcube_contacts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php index f72e42766..55e5f6fb3 100644 --- a/program/lib/Roundcube/rcube_contacts.php +++ b/program/lib/Roundcube/rcube_contacts.php @@ -380,7 +380,7 @@ class rcube_contacts extends rcube_addressbook foreach ((array)$row[$col] as $value) { if ($this->compare_search_value($colname, $value, $search, $mode)) { $found[$colname] = true; - break 2; + break; } } } From 9284d4a8c91614063c53cca19627a2d514531718 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 2 Oct 2018 16:29:48 +0200 Subject: [PATCH 08/13] Update changelog --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index e4d9e409d..ce9144cc2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,6 +23,7 @@ CHANGELOG Roundcube Webmail - New_user_identity: Fix %fu/%u vars substitution in user specific LDAP params (#6419) - Fix support for "allow-from " in "x_frame_options" config option (#6449) - Fix bug where valid content between HTML comments could have been skipped in some cases (#6464) +- Fix multiple VCard field search (#6466) RELEASE 1.4-beta ---------------- From 4920f3ef2326fa0b1c72da7f8f7b325782a46fe4 Mon Sep 17 00:00:00 2001 From: urusha Date: Wed, 3 Oct 2018 08:06:38 +0000 Subject: [PATCH 09/13] krb_authentication fixes (#6471) * krb_authentication: remove default principal krb_authentication_context must be set to the right value to make GSSAPI work, we should not have any default for it outside config files, it could confuse users. We already handle empty/bad context in rcube_imap_generic.php, Net_Sieve, Net_SMTP. * krb_authentication: config.php.dist fix GSSAPI is better for searching, since GSS API is not used widely. host.fqdn@REALM.NAME is actually never used without service-prefix, on the other side it may be valid to use 'computername$' or 'username' with Samba/Active Directory, the common name for all these - 'principal'. * krb_authentication: raise error on empty context --- plugins/krb_authentication/config.inc.php.dist | 4 ++-- plugins/krb_authentication/krb_authentication.php | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/krb_authentication/config.inc.php.dist b/plugins/krb_authentication/config.inc.php.dist index ae67f89a5..975cacb85 100644 --- a/plugins/krb_authentication/config.inc.php.dist +++ b/plugins/krb_authentication/config.inc.php.dist @@ -9,7 +9,7 @@ // Unlike $config['default_host'] this must be a string! $config['krb_authentication_host'] = ''; -// GSS API security context. +// GSSAPI security context. // Single value or an array with per-protocol values. Example: // // $config['krb_authentication_context'] = array( @@ -17,4 +17,4 @@ $config['krb_authentication_host'] = ''; // 'smtp' => 'smtp/host.fqdn@REALM.NAME', // 'sieve' => 'sieve/host.fqdn@REALM.NAME', // ); -$config['krb_authentication_context'] = 'host.fqdn@REALM.NAME'; +$config['krb_authentication_context'] = 'principal@REALM.NAME'; diff --git a/plugins/krb_authentication/krb_authentication.php b/plugins/krb_authentication/krb_authentication.php index 95adc771d..e5b67ed00 100644 --- a/plugins/krb_authentication/krb_authentication.php +++ b/plugins/krb_authentication/krb_authentication.php @@ -146,6 +146,10 @@ class krb_authentication extends rcube_plugin $context = $context[$protocol]; } - return $context ?: 'host.fqdn@REALM.NAME'; + if (empty($context)) { + rcube::raise_error("Empty GSSAPI context.", true); + } + + return $context; } } From 511ecd095cf1f5906de050377bbe0f6ab6f216ca Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 3 Oct 2018 10:15:15 +0200 Subject: [PATCH 10/13] Add $protocol to the error message --- plugins/krb_authentication/krb_authentication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/krb_authentication/krb_authentication.php b/plugins/krb_authentication/krb_authentication.php index e5b67ed00..57b79e526 100644 --- a/plugins/krb_authentication/krb_authentication.php +++ b/plugins/krb_authentication/krb_authentication.php @@ -147,7 +147,7 @@ class krb_authentication extends rcube_plugin } if (empty($context)) { - rcube::raise_error("Empty GSSAPI context.", true); + rcube::raise_error("Empty GSSAPI context ($protocol).", true); } return $context; From 02ddb8d5357b203728c5d08f5fb3f68ecdf70108 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 5 Oct 2018 16:19:52 +0200 Subject: [PATCH 11/13] Use RCUBE_VERSION in defaults.inc.php, RCMAIL_VERSION is undefined when using Framework only --- config/defaults.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/defaults.inc.php b/config/defaults.inc.php index 312a7ec35..653dfcfaa 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -569,7 +569,7 @@ $config['max_group_members'] = 0; $config['product_name'] = 'Roundcube Webmail'; // Add this user-agent to message headers when sending -$config['useragent'] = 'Roundcube Webmail/'.RCMAIL_VERSION; +$config['useragent'] = 'Roundcube Webmail/'.RCUBE_VERSION; // try to load host-specific configuration // see https://github.com/roundcube/roundcubemail/wiki/Configuration:-Multi-Domain-Setup From b12694184658492c936582f1ebaedececf53da36 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 6 Oct 2018 10:59:19 +0200 Subject: [PATCH 12/13] Fix session issue on long running requests (#6470) --- CHANGELOG | 1 + program/lib/Roundcube/rcube_session.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index ce9144cc2..48ff235c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,7 @@ CHANGELOG Roundcube Webmail - Fix support for "allow-from " in "x_frame_options" config option (#6449) - Fix bug where valid content between HTML comments could have been skipped in some cases (#6464) - Fix multiple VCard field search (#6466) +- Fix session issue on long running requests (#6470) RELEASE 1.4-beta ---------------- diff --git a/program/lib/Roundcube/rcube_session.php b/program/lib/Roundcube/rcube_session.php index 33bcaddc3..32faed526 100644 --- a/program/lib/Roundcube/rcube_session.php +++ b/program/lib/Roundcube/rcube_session.php @@ -306,7 +306,7 @@ abstract class rcube_session $cache = null; } // use internal data for fast requests (up to 0.5 sec.) - else if ($key == $this->key && (!$this->vars || $ts - $this->start < 0.5)) { + else if ($key == $this->key && (!$this->vars || microtime(true) - $this->start < 0.5)) { $cache = $this->vars; } else { // else read data again From 38255ff52a9df7f009343bfd913b2b9e4f59f068 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 6 Oct 2018 11:29:57 +0200 Subject: [PATCH 13/13] Elastic: Fix duplicate recipient after using Tab key in recipient input (regression) --- skins/elastic/ui.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 3ca049f99..e4b62b846 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -2796,7 +2796,7 @@ function rcube_elastic_ui() */ function recipient_input(obj) { - var list, input, ac_props, + var list, input, ac_props, update_lock, input_len_update = function() { input.css('width', input.val().length * 10 + 15); }, @@ -2839,6 +2839,12 @@ function rcube_elastic_ui() update_func = function(text) { var result; + if (update_lock) { + return; + } + + update_lock = true; + text = (text || input.val()).replace(/[,;\s]+$/, ''); result = recipient_input_parser(text); @@ -2847,28 +2853,24 @@ function rcube_elastic_ui() }); // setTimeout() here is needed for proper input reset on paste event + // This is also the reason why we need parse_lock setTimeout(function() { input.val(result.text); apply_func(); input_len_update(); + update_lock = false; }, 1); return result.recipients.length > 0; }, parse_func = function(e) { - // On paste the text is not yet in the input we have to use clipboard. - // Also because on paste new-line characters are replaced by spaces (#6460) - if (e.type == 'paste') { - update_func((e.originalEvent.clipboardData || window.clipboardData).getData('text')); - return; - } - - // Note: it can be also executed when autocomplete inserts a recipient - update_func(); - if (e.type == 'blur') { list.removeClass('focus'); } + + // On paste the text is not yet in the input we have to use clipboard. + // Also because on paste new-line characters are replaced by spaces (#6460) + update_func(e.type == 'paste' ? (e.originalEvent.clipboardData || window.clipboardData).getData('text') : null); }, keydown_func = function(e) { // On Backspace remove the last recipient