Projects
Kolab:16
kolab-syncroton
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 19
View file
kolab-syncroton.spec
Changed
@@ -36,7 +36,7 @@ %global _ap_sysconfdir %{_sysconfdir}/%{httpd_name} Name: kolab-syncroton -Version: 2.3.8 +Version: 2.3.10 Release: 1%{?dist} Summary: ActiveSync for Kolab Groupware @@ -195,6 +195,19 @@ %attr(0770,%{httpd_user},%{httpd_group}) %{_var}/log/%{name} %changelog +* Thu Mar 8 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 2.3.10-1 +- Release 2.3.10 + +* Fri Mar 2 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 2.3.9-1 +- Release 2.3.9 + +* Fri Feb 2 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 2.3.8-3 +- Fix redundant GETMETADATA requests for mail folders + +* Wed Jan 24 2018 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 2.3.8-2 +- Fix logging +- Fix version number + * Wed Dec 20 2017 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 2.3.8-1 - Release 2.3.8 @@ -293,9 +306,6 @@ * Sun Sep 8 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.2.0-1 - Release version 2.2.0 -* Wed Sep 3 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.1.0-1 -- Bug fixes for #1658, and attachment sending - * Tue Mar 12 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.1-0.2.rc2 - New upstream release
View file
debian.changelog
Changed
@@ -1,3 +1,28 @@ +kolab-syncroton (2.3.10-0~kolab1) unstable; urgency=low + + * Release 2.3.10 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Thu, 8 Mar 2018 15:13:40 +0200 + +kolab-syncroton (2.3.9-0~kolab1) unstable; urgency=low + + * Release 2.3.9 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Fri, 2 Mar 2018 15:13:40 +0200 + +kolab-syncroton (2.3.8-0~kolab3) unstable; urgency=low + + * Fix redundant GETMETADATA requests for mail folders + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Fri, Feb 2 2018 15:13:40 +0200 + +kolab-syncroton (2.3.8-0~kolab2) unstable; urgency=low + + * Fix logging + * Fix version number + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Wed, Jan 24 2018 15:13:40 +0200 + kolab-syncroton (2.3.8-0~kolab1) unstable; urgency=low * Release 2.3.8
View file
kolab-syncroton-2.3.8.tar.gz/config/config.inc.php.dist -> kolab-syncroton-2.3.10.tar.gz/config/config.inc.php.dist
Changed
@@ -8,9 +8,6 @@ // Enables logging to a separate directory for every user/device $config['activesync_user_log'] = false; -// Enable per-user debugging only if /var/log/kolab-syncroton/<username>/ folder exists -$config['activesync_user_debug'] = false; - // If specified all ActiveSync-related logs will be saved to this file // Note: This doesn't change Roundcube Framework log locations $config['activesync_log_file'] = null;
View file
kolab-syncroton-2.3.8.tar.gz/lib/ext/Syncroton/Command/FolderSync.php -> kolab-syncroton-2.3.10.tar.gz/lib/ext/Syncroton/Command/FolderSync.php
Changed
@@ -208,7 +208,28 @@ $updates[] = $change; } - + + // Find changes in case backend does not support folder changes detection. + // On some backends getChangedFolders() can return an empty result. + // We make sure all is up-to-date comparing folder properties. + foreach ($clientFoldersIds as $folderId) { + if (isset($serverFolders[$folderId])) { + $c = $clientFolders[$folderId]; + $s = $serverFolders[$folderId]; + + if ($c->displayName !== $s->displayName + || strval($c->parentId) !== strval($s->parentId) + || $c->type != $s->type + ) { + $c->displayName = $s->displayName; + $c->parentId = $s->parentId; + $c->type = $s->type; + + $updates[] = $c; + } + } + } + // calculate deleted entries $serverDiff = array_diff($clientFoldersIds, $serverFoldersIds); foreach ($serverDiff as $serverFolderId) {
View file
kolab-syncroton-2.3.8.tar.gz/lib/ext/Syncroton/Command/MoveItems.php -> kolab-syncroton-2.3.10.tar.gz/lib/ext/Syncroton/Command/MoveItems.php
Changed
@@ -23,7 +23,7 @@ const STATUS_SUCCESS = 3; protected $_defaultNameSpace = 'uri:Move'; - protected $_documentElement = 'Moves'; + protected $_documentElement = 'MoveItems'; /** * list of items to move @@ -83,7 +83,8 @@ $newId = $dataController->moveItem($move['srcFldId'], $move['srcMsgId'], $move['dstFldId']); $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'Status', Syncroton_Command_MoveItems::STATUS_SUCCESS)); - $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'DstMsgId', $newId)); + if ($newId) + $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'DstMsgId', $newId)); } catch (Syncroton_Exception_Status $e) { $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'Status', $e->getCode())); } catch (Exception $e) {
View file
kolab-syncroton-2.3.8.tar.gz/lib/ext/Syncroton/Command/Sync.php -> kolab-syncroton-2.3.10.tar.gz/lib/ext/Syncroton/Command/Sync.php
Changed
@@ -544,7 +544,15 @@ // request already maybe } while (Syncroton_Server::validateSession() && time() - $intervalStart < $this->_heartbeatInterval - (Syncroton_Registry::getPingTimeout() + 10)); } - + + // First check for folders hierarchy changes + foreach ($this->_collections as $collectionData) { + if (! ($collectionData->folder instanceof Syncroton_Model_IFolder)) { + $sync->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Status', self::STATUS_FOLDER_HIERARCHY_HAS_CHANGED)); + return $this->_outputDom; + } + } + foreach($this->_collections as $collectionData) { $collectionChanges = 0; @@ -558,15 +566,8 @@ */ $deletedContentStates = array(); - // invalid collectionid provided - if (! ($collectionData->folder instanceof Syncroton_Model_IFolder)) { - $collection = $collections->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Collection')); - $collection->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'SyncKey', 0)); - $collection->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'CollectionId', $collectionData->collectionId)); - $collection->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Status', self::STATUS_FOLDER_HIERARCHY_HAS_CHANGED)); - // invalid synckey provided - } elseif (! ($collectionData->syncState instanceof Syncroton_Model_ISyncState)) { + if (! ($collectionData->syncState instanceof Syncroton_Model_ISyncState)) { // set synckey to 0 $collection = $collections->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Collection')); $collection->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'SyncKey', 0));
View file
kolab-syncroton-2.3.8.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage5.php -> kolab-syncroton-2.3.10.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage5.php
Changed
@@ -19,11 +19,11 @@ class Syncroton_Wbxml_Dtd_ActiveSync_CodePage5 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract { protected $_codePageNumber = 5; - + protected $_codePageName = 'Move'; - - protected $_tags = array( - 'Moves' => 0x05, + + protected $_tags = array( + 'MoveItems' => 0x05, 'Move' => 0x06, 'SrcMsgId' => 0x07, 'SrcFldId' => 0x08,
View file
kolab-syncroton-2.3.8.tar.gz/lib/kolab_sync.php -> kolab-syncroton-2.3.10.tar.gz/lib/kolab_sync.php
Changed
@@ -46,7 +46,7 @@ public $password; const CHARSET = 'UTF-8'; - const VERSION = "2.3.7"; + const VERSION = "2.3.10"; /** @@ -142,7 +142,7 @@ $this->plugins->exec_hook('ready', array('task' => 'syncroton')); // Set log directory per-user - $this->set_log_dir($this->username ?: $_SERVER['PHP_AUTH_USER']); + $this->set_log_dir(); // Save user password for Roundcube Framework $this->password = $_SERVER['PHP_AUTH_PW']; @@ -384,13 +384,13 @@ /** * Set logging directory per-user */ - protected function set_log_dir($username) + protected function set_log_dir() { - if (empty($username)) { + if (empty($this->username)) { return; } - $this->logger->set_username($username); + $this->logger->set_username($this->username); $user_debug = $this->config->get('per_user_logging'); $user_log = $user_debug || $this->config->get('activesync_user_log'); @@ -400,15 +400,9 @@ } $log_dir = $this->config->get('log_dir'); - $log_dir .= DIRECTORY_SEPARATOR . $username; + $log_dir .= DIRECTORY_SEPARATOR . $this->username; - // in user_debug mode enable logging only if user directory exists - if ($user_debug) { - if (!is_dir($log_dir)) { - return; - } - } - else if (!is_dir($log_dir)) { + if (!$user_debug && !is_dir($log_dir)) { if (!mkdir($log_dir, 0770)) { return; } @@ -424,28 +418,12 @@ } } - // make sure we're using debug mode where possible, if ($user_debug) { - $this->config->set('debug_level', 1); - $this->config->set('memcache_debug', true); - $this->config->set('imap_debug', true); - $this->config->set('ldap_debug', true); - $this->config->set('smtp_debug', true); - $this->config->set('sql_debug', true); - - // SQL/IMAP debug need to be set directly on the object instance - // it's already initialized/configured - if ($db = $this->get_dbh()) { - $db->set_debug(true); - } - if ($storage = $this->get_storage()) { - $storage->set_debug(true); - } - - $this->logger->mode = kolab_sync_logger::DEBUG; + $this->per_user_log_dir = $log_dir; + } + else { + $this->config->set('log_dir', $log_dir); } - - $this->config->set('log_dir', $log_dir); // re-set PHP error logging if (($this->config->get('debug_level') & 1) && $this->config->get('log_driver') != 'syslog') { @@ -453,6 +431,13 @@ } } + /** + * Get the per-user log directory + */ + public function get_user_log_dir() + { + return $this->per_user_log_dir; + } /** * Send HTTP 503 response. @@ -478,7 +463,10 @@ $this->gc_run(); // write performance stats to logs/console - if ($this->config->get('devel_mode')) { + if ($this->config->get('devel_mode') || $this->config->get('performance_stats')) { + // make sure logged numbers use unified format + setlocale(LC_NUMERIC, 'en_US.utf8', 'en_US.UTF-8', 'en_US', 'C'); + if (function_exists('memory_get_usage')) $mem = sprintf('%.1f', memory_get_usage() / 1048576); if (function_exists('memory_get_peak_usage'))
View file
kolab-syncroton-2.3.8.tar.gz/lib/kolab_sync_backend.php -> kolab-syncroton-2.3.10.tar.gz/lib/kolab_sync_backend.php
Changed
@@ -176,7 +176,7 @@ } // Activesync folder identifier (serverId) - $folder_type = $typedata[$folder]; + $folder_type = $typedata[$folder] ?: 'mail'; $folder_id = self::folder_id($folder, $folder_type); $folders_list[$folder_id] = $this->folder_data($folder, $folder_type); @@ -216,7 +216,7 @@ array_pop($items); $parent_name = implode($items, $delim); - $parent_type = $typedata[$parent_name]; + $parent_type = $typedata[$parent_name] ?: 'mail'; $parent_id = self::folder_id($parent_name, $parent_type); if (isset($folders[$parent_id])) {
View file
kolab-syncroton-2.3.8.tar.gz/lib/kolab_sync_backend_common.php -> kolab-syncroton-2.3.10.tar.gz/lib/kolab_sync_backend_common.php
Changed
@@ -87,7 +87,7 @@ public function create($object) { if (! $object instanceof $this->interface_name) { - throw new InvalidArgumentException('$object must be instanace of ' . $this->interface_name); + throw new InvalidArgumentException('$object must be instance of ' . $this->interface_name); } $data = $this->object_to_array($object); @@ -99,13 +99,13 @@ $cols[] = $this->db->quote_identifier($key); } - $this->db->query('INSERT INTO `' . $this->table_name . '`' . ' (' . implode(', ', $cols) . ')' + $result = $this->db->query('INSERT INTO `' . $this->table_name . '`' . ' (' . implode(', ', $cols) . ')' . ' VALUES(' . implode(', ', array_fill(0, count($cols), '?')) . ')', array_values($data) ); - if (!$this->db->insert_id($this->table_name)) { - // @TODO: throw exception + if ($this->db->is_error($result)) { + throw new Exception('Failed to save instance of ' . $this->interface_name); } return $object;
View file
kolab-syncroton-2.3.8.tar.gz/lib/kolab_sync_data_calendar.php -> kolab-syncroton-2.3.10.tar.gz/lib/kolab_sync_data_calendar.php
Changed
@@ -440,27 +440,23 @@ $event['valarms'] = $this->to_kolab_alarm($data->reminder, $event); } - $event['attendees'] = array(); - $event['categories'] = array(); + $attendees = array(); + $categories = array(); // Categories if (isset($data->categories)) { foreach ($data->categories as $category) { - $event['categories'][] = $category; + $categories[] = $category; } } // Organizer - if (!$is_exception) { - $name = $data->organizerName; - $email = $data->organizerEmail; - if ($name || $email) { - $event['attendees'][] = array( - 'role' => 'ORGANIZER', - 'name' => $name, - 'email' => $email, - ); - } + if (!$is_exception && ($organizer_email = $data->organizerEmail)) { + $attendees[] = array( + 'role' => 'ORGANIZER', + 'name' => $data->organizerName, + 'email' => $organizer_email, + ); } // Attendees @@ -473,12 +469,17 @@ if ($is_outlook && !empty($entry) && $data->timezone == $dummy_tz && $data->responseRequested && !empty($data->attendees) ) { - $event['attendees'] = $entry['attendees']; + $attendees = $entry['attendees']; } else if (isset($data->attendees)) { $statusMap = array_flip($this->attendeeStatusMap); foreach ($data->attendees as $attendee) { + if ($attendee->email && $attendee->email == $organizer_email) { + continue; + } + $role = false; + if (isset($attendee->attendeeType)) { $role = array_search($attendee->attendeeType, $this->attendeeTypeMap); } @@ -499,7 +500,7 @@ $_attendee['rsvp'] = true; } } - else if (!empty($event['attendees'])) { + else if (!empty($event['attendees']) && !empty($attendee->email)) { // copy the old attendee status foreach ($event['attendees'] as $old_attendee) { if ($old_attendee['email'] == $_attendee['email'] && isset($old_attendee['status'])) { @@ -510,10 +511,22 @@ } } - $event['attendees'][] = $_attendee; + $attendees[] = $_attendee; } } + // Make sure the event has the organizer set + if (!$organizer_email && ($identity = kolab_sync::get_instance()->user->get_identity())) { + $attendees[] = array( + 'role' => 'ORGANIZER', + 'name' => $identity['name'], + 'email' => $identity['email'], + ); + } + + $event['attendees'] = $attendees; + $event['categories'] = $categories; + // recurrence (and exceptions) if (!$is_exception) { $event['recurrence'] = $this->recurrence_to_kolab($data, $folderid, $timezone); @@ -525,13 +538,16 @@ // Unfortunately Outlook also sends an update when no SEQUENCE bump // is needed, e.g. when updating attendee status. // We try our best to bump the SEQUENCE only when expected - if ($is_outlook && !empty($entry) && !$is_exception && !empty($data->attendees) && $data->timezone != $dummy_tz) { + if (!empty($entry) && !$is_exception && !empty($data->attendees) && $data->timezone != $dummy_tz) { if ($last_update = $this->getKolabDataItem($event, 'x-custom.X-ACTIVESYNC-DTSTAMP')) { $last_update = new DateTime($last_update); } if ($data->dtStamp && $data->dtStamp != $last_update) { - $event['sequence'] += 1; + if ($this->has_significant_changes($event, $entry)) { + $event['sequence']++; + $this->logger->debug('Found significant changes in the updated event. Bumping SEQUENCE to ' . $event['sequence']); + } } } @@ -954,4 +970,65 @@ $entry->endTime = $rounded; } } + + /** + * Check if the new event version has any significant changes + */ + protected function has_significant_changes($event, $old) + { + // Calendar namespace fields + foreach (array('allday', 'start', 'end', 'location', 'recurrence') as $key) { + if ($event[$key] != $old[$key]) { + // Comparing recurrence is tricky as there can be differences in default + // value handling. Let's try to handle most common cases + if ($key == 'recurrence' && $this->fixed_recurrence($event) == $this->fixed_recurrence($old)) { + continue; + } + + return true; + } + } + + if (count($event['attendees']) != count($old['attendees'])) { + return true; + } + + foreach ($event['attendees'] as $idx => $attendee) { + $old_attendee = $old['attendees'][$idx]; + + if ($old_attendee['email'] != $attendee['email'] + || ($attendee['role'] != 'ORGANIZER' + && $attendee['status'] != $old_attendee['status'] + && $attendee['status'] == 'NEEDS-ACTION') + ) { + return true; + } + } + + return false; + } + + /** + * Unify recurrence spec. for comparison + */ + protected function fixed_recurrence($event) + { + $rec = (array) $event['recurrence']; + + // Add BYDAY if not exists + if ($rec['FREQ'] == 'WEEKLY' && empty($rec['BYDAY'])) { + $days = array('SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'); + $day = $event['start']->format('w'); + + $rec['BYDAY'] = $days[$day]; + } + + if (!$rec['INTERVAL']) { + $rec['INTERVAL'] = 1; + } + + ksort($rec); + + return $rec; + } }
View file
kolab-syncroton-2.3.8.tar.gz/lib/kolab_sync_logger.php -> kolab-syncroton-2.3.10.tar.gz/lib/kolab_sync_logger.php
Changed
@@ -59,7 +59,7 @@ $rcube = rcube::get_instance(); $logfile = $rcube->config->get('activesync_log_file'); $format = $rcube->config->get('log_date_format', 'd-M-Y H:i:s O'); - $log_dir = $rcube->config->get('log_dir'); + $log_dir = $rcube->get_user_log_dir() ?: $rcube->config->get('log_dir'); if (is_numeric($method)) { $mode = $method; @@ -88,6 +88,10 @@ } $logfile = $log_dir . DIRECTORY_SEPARATOR . $file; + + if (version_compare(version_parse(RCUBE_VERSION), '1.4.0') >= 0) { + $logfile .= $rcube->config->get('log_file_ext', '.log'); + } } else if ($logfile[0] != '/') { $logfile = $log_dir . DIRECTORY_SEPARATOR . $logfile;
View file
kolab-syncroton.dsc
Changed
@@ -2,7 +2,7 @@ Source: kolab-syncroton Binary: kolab-syncroton Architecture: all -Version: 2.3.8-0~kolab1 +Version: 2.3.10-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.kolab.org/ @@ -12,5 +12,5 @@ Package-List: kolab-syncroton deb utils extra Files: - 00000000000000000000000000000000 0 kolab-syncroton-2.3.8.tar.gz + 00000000000000000000000000000000 0 kolab-syncroton-2.3.10.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.