diff -Nru z-push-2.4.4/config/apache2/z-push-autodiscover.conf z-push-2.4.5/config/apache2/z-push-autodiscover.conf --- z-push-2.4.4/config/apache2/z-push-autodiscover.conf 2018-07-25 19:42:25.000000000 +0000 +++ z-push-2.4.5/config/apache2/z-push-autodiscover.conf 2018-11-07 13:46:58.000000000 +0000 @@ -1,4 +1,6 @@ # Z-Push AutoDiscover - ActiveSync over-the-air - default Apache configuration - AliasMatch (?i)/Autodiscover/Autodiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php" + Alias /AutoDiscover/AutoDiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php" + Alias /Autodiscover/Autodiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php" + Alias /autodiscover/autodiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php" diff -Nru z-push-2.4.4/config/nginx/z-push-autodiscover.conf z-push-2.4.5/config/nginx/z-push-autodiscover.conf --- z-push-2.4.4/config/nginx/z-push-autodiscover.conf 1970-01-01 00:00:00.000000000 +0000 +++ z-push-2.4.5/config/nginx/z-push-autodiscover.conf 2018-11-07 13:46:58.000000000 +0000 @@ -0,0 +1,4 @@ +alias /usr/share/z-push/autodiscover/autodiscover.php; + +access_log /var/log/nginx/z-push-autodiscover-access.log; +error_log /var/log/nginx/z-push-autodiscover-error.log; diff -Nru z-push-2.4.4/config/nginx/z-push.conf z-push-2.4.5/config/nginx/z-push.conf --- z-push-2.4.4/config/nginx/z-push.conf 2018-07-25 19:42:25.000000000 +0000 +++ z-push-2.4.5/config/nginx/z-push.conf 2018-11-07 13:46:58.000000000 +0000 @@ -18,7 +18,7 @@ #fastcgi_param HTTP_PROXY ""; # Mitigate https://httpoxy.org/ vulnerabilities #fastcgi_read_timeout 3660; # Z-Push Ping might run 3600s, but to be safe - location ~* /Microsoft-Server-ActiveSync { + location /Microsoft-Server-ActiveSync { alias /usr/share/z-push/index.php; access_log /var/log/nginx/z-push-access.log; @@ -29,24 +29,19 @@ client_body_buffer_size 128k; # Select one of the fastcgi_pass values or adapt to your configuration - #fastcgi_pass unix:/var/run/php5-fpm.sock; # for PHP 5.X Debian/Ubuntu - #fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # for PHP 7.X Debian/Ubuntu - #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; # usually RedHat and its derivatives - #fastcgi_pass 127.0.0.1:9000; # default php-fpm config + include snippets/z-push-php.conf; } - location ~* /AutoDiscover/AutoDiscover.xml { - alias /usr/share/z-push/autodiscover/autodiscover.php; - - access_log /var/log/nginx/z-push-autodiscover-access.log; - error_log /var/log/nginx/z-push-autodiscover-error.log; - - # Select one of the fastcgi_pass values or adapt to your configuration - #fastcgi_pass unix:/var/run/php5-fpm.sock; # for PHP 5.X Debian/Ubuntu - #fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # for PHP 7.X Debian/Ubuntu - #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; # usually RedHat and its derivatives - #fastcgi_pass 127.0.0.1:9000; # default php-fpm config - - #fastcgi_index autodiscover.php; + location /AutoDiscover/AutoDiscover.xml { + include snippets/z-push-autodiscover.conf; + include snippets/z-push-php.conf; + } + location /Autodiscover/Autodiscover.xml { + include snippets/z-push-autodiscover.conf; + include snippets/z-push-php.conf; + } + location /autodiscover/autodiscover.xml { + include snippets/z-push-autodiscover.conf; + include snippets/z-push-php.conf; } -} \ No newline at end of file +} diff -Nru z-push-2.4.4/config/nginx/z-push-php.conf z-push-2.4.5/config/nginx/z-push-php.conf --- z-push-2.4.4/config/nginx/z-push-php.conf 1970-01-01 00:00:00.000000000 +0000 +++ z-push-2.4.5/config/nginx/z-push-php.conf 2018-11-07 13:46:58.000000000 +0000 @@ -0,0 +1,6 @@ +# Select one of the fastcgi_pass values or adapt to your configuration +#fastcgi_pass unix:/var/run/php5-fpm.sock; # for PHP 5.X Debian/Ubuntu +#fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # for PHP 7.X Debian/Ubuntu +#fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; # usually RedHat and its derivatives +#fastcgi_pass 127.0.0.1:9000; # default php-fpm config + diff -Nru z-push-2.4.4/config/z-push-rhel6.lr z-push-2.4.5/config/z-push-rhel6.lr --- z-push-2.4.4/config/z-push-rhel6.lr 1970-01-01 00:00:00.000000000 +0000 +++ z-push-2.4.5/config/z-push-rhel6.lr 2018-11-07 13:46:58.000000000 +0000 @@ -0,0 +1,6 @@ +/var/log/z-push/*.log { + size 1k + create 664 root z-push + compress + rotate 4 +} diff -Nru z-push-2.4.4/debian/changelog z-push-2.4.5/debian/changelog --- z-push-2.4.4/debian/changelog 2018-08-09 10:41:28.000000000 +0000 +++ z-push-2.4.5/debian/changelog 2018-12-18 09:15:25.000000000 +0000 @@ -1,3 +1,26 @@ +z-push (2.4.5-2) unstable; urgency=medium + + * [95e4851] d/control: relay an php-mapi built with php7.3 + Some z-push packages are depending on php-mapi which itself is build since + 8.6.90-1 against PHP 7.3. Adding a versioned depends on this version at + least. + * [987142e] d/copyright: update copyright information + * [ac1c896] d/rules: install README files into /u/s/d/$package + * [721c41c] QA: adding PHP systax check while running build + + -- Carsten Schoenert Tue, 18 Dec 2018 10:15:25 +0100 + +z-push (2.4.5-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [1d619da] debian/control: increase Standards-Version to 4.2.1 + + [ Roel van Meer ] + * [2c6d56e] New upstream version 2.4.5 + * [f293443] control: Let z-push-common depend on php-mbstring + + -- Roel van Meer Thu, 15 Nov 2018 16:37:58 +0100 + z-push (2.4.4-1) unstable; urgency=medium * [918fc68] New upstream version 2.4.4 diff -Nru z-push-2.4.4/debian/control z-push-2.4.5/debian/control --- z-push-2.4.4/debian/control 2018-07-11 19:06:49.000000000 +0000 +++ z-push-2.4.5/debian/control 2018-12-18 09:10:43.000000000 +0000 @@ -9,8 +9,9 @@ Build-Depends: debhelper (>= 11), dh-exec, + php-cli, po-debconf, -Standards-Version: 4.1.4 +Standards-Version: 4.2.1 Vcs-Git: https://salsa.debian.org/giraffe-team/z-push.git Vcs-Browser: https://salsa.debian.org/giraffe-team/z-push Homepage: http://z-push.org/download/ @@ -55,6 +56,7 @@ Depends: php, php-cli, + php-mbstring, php-soap, ${misc:Depends}, Replaces: @@ -172,7 +174,7 @@ Architecture: all Depends: php-cli, - php-mapi, + php-mapi (>= 8.6.60-1~), z-push-common (= ${binary:Version}), ${misc:Depends}, Replaces: z-push-kopano @@ -207,7 +209,7 @@ Architecture: all Depends: php-cli, - php-mapi, + php-mapi (>= 8.6.60-1~), ${misc:Depends}, Description: open source implementation of the ActiveSync protocol - Kopano GAB sync Z-Push is an implementation of the ActiveSync protocol which is used diff -Nru z-push-2.4.4/debian/copyright z-push-2.4.5/debian/copyright --- z-push-2.4.4/debian/copyright 2018-04-27 15:22:47.000000000 +0000 +++ z-push-2.4.5/debian/copyright 2018-12-18 08:01:51.000000000 +0000 @@ -1,14 +1,16 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Z-Push -Source: http://z-push.org/download/ +Source: https://stash.z-hub.io/projects/ZP/repos/z-push/browse Files: * Copyright: 2007-2016, Zarafa Deutschland GmbH + 2017-2018, Zarafa B.V. and its licensors License: AGPL-3 Files: debian/* Copyright: 2010-2014, Wolfram Quester - 2016, Carsten Schoenert + 2016-2018, Carsten Schoenert + 2017-2018, Roel van Meer License: GPL-2+ Files: src/backend/caldav/* diff -Nru z-push-2.4.4/debian/rules z-push-2.4.5/debian/rules --- z-push-2.4.4/debian/rules 2018-04-27 15:22:47.000000000 +0000 +++ z-push-2.4.5/debian/rules 2018-12-18 09:09:42.000000000 +0000 @@ -1,10 +1,5 @@ #!/usr/bin/make -f # -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -12,16 +7,45 @@ # getting DEB_VERSION from helper without manually parsing the changelog file include /usr/share/dpkg/pkg-info.mk +PHP_FILES := $(shell find src tools -type f -name "*.php") + %: dh $@ -override_dh_install: +check_php_files: + ######################################### + # Perfoming syntax check for PHP files. # + ######################################### + @ERROR=0 ;\ + for file in $(PHP_FILES); do \ + if ! /usr/bin/php -l $${file} 1>/dev/null ; then \ + echo "syntax check for $${file} failed!" ;\ + ERROR=1 ;\ + fi \ + done ;\ + if [ "$${ERROR}" -eq "1" ]; then \ + echo "Error(s) found while syntax check! Exciting!" ;\ + exit 99 ;\ + else \ + echo "No syntax error(s) found." ;\ + fi + +override_dh_install: check_php_files find src -type f \( -name "*.php" \) -exec chmod 644 {} \; sed -e "s/DEB_VERSION/${DEB_VERSION}/" debian/version.php.in > src/version.php dh_install -X LICENSE # Rename so we can have dh_installdocs install this with a proper name. cp -a src/autodiscover/INSTALL src/autodiscover/README.autodiscover +override_dh_installdocs: + dh_installdocs + # Move some README files to appropriate folder. + mv debian/z-push-backend-carddav/usr/share/z-push/backend/carddav/README \ + debian/z-push-backend-carddav/usr/share/doc/z-push-backend-carddav/z-push-backend-carddav.README + mv debian/z-push-backend-imap/usr/share/z-push/backend/imap/README \ + debian/z-push-backend-imap/usr/share/doc/z-push-backend-imap/z-push-backend-imap.README + + override_dh_fixperms-indep: dh_fixperms chmod 755 debian/z-push-backend-kopano/usr/share/z-push/backend/kopano/listfolders.php diff -Nru z-push-2.4.4/src/backend/kopano/kopano.php z-push-2.4.5/src/backend/kopano/kopano.php --- z-push-2.4.4/src/backend/kopano/kopano.php 2018-07-25 19:42:25.000000000 +0000 +++ z-push-2.4.5/src/backend/kopano/kopano.php 2018-11-07 13:46:58.000000000 +0000 @@ -2249,7 +2249,7 @@ return $recipientGal; } // get the certificate every time because caching the certificate is less expensive than opening addressbook entry again - $abentries = mapi_table_queryrows($table, array(PR_ENTRYID, PR_DISPLAY_NAME, PR_EMS_AB_TAGGED_X509_CERT, PR_OBJECT_TYPE), 0, $rowsToQuery); + $abentries = mapi_table_queryrows($table, array(PR_ENTRYID, PR_DISPLAY_NAME, PR_EMS_AB_TAGGED_X509_CERT, PR_OBJECT_TYPE, PR_SMTP_ADDRESS), 0, $rowsToQuery); for ($i = 0, $nrEntries = count($abentries); $i < $nrEntries; $i++) { if ($abentries[$i][PR_OBJECT_TYPE] == MAPI_DISTLIST) { // dist lists must be expanded into their members @@ -2263,7 +2263,7 @@ } } elseif ($abentries[$i][PR_OBJECT_TYPE] == MAPI_MAILUSER) { - $recipientGal[] = $this->createResolveRecipient(SYNC_RESOLVERECIPIENTS_TYPE_GAL, $to, $abentries[$i]); + $recipientGal[] = $this->createResolveRecipient(SYNC_RESOLVERECIPIENTS_TYPE_GAL, $abentries[$i][PR_SMTP_ADDRESS], $abentries[$i]); } } diff -Nru z-push-2.4.4/src/backend/kopano/mapiphpwrapper.php z-push-2.4.5/src/backend/kopano/mapiphpwrapper.php --- z-push-2.4.4/src/backend/kopano/mapiphpwrapper.php 2018-07-25 19:42:25.000000000 +0000 +++ z-push-2.4.5/src/backend/kopano/mapiphpwrapper.php 2018-11-07 13:46:58.000000000 +0000 @@ -226,8 +226,19 @@ * @return */ public function ImportPerUserReadStateChange($readstates) { + $categories = array(); + $isKoe = ZPush::GetDeviceManager()->IsKoe(); foreach($readstates as $readstate) { - $this->importer->ImportMessageReadFlag($this->prefix.bin2hex($readstate["sourcekey"]), $readstate["flags"] & MSGFLAG_READ); + if ($isKoe) { + $categories = array(); + $entryid = mapi_msgstore_entryidfromsourcekey($this->store, $this->folderid, $readstate["sourcekey"]); + if ($entryid) { + $mapimessage = mapi_msgstore_openentry($this->store, $entryid); + $message = $this->mapiprovider->GetMessage($mapimessage, $this->contentparameters); + $categories = $message->categories; + } + } + $this->importer->ImportMessageReadFlag($this->prefix.bin2hex($readstate["sourcekey"]), $readstate["flags"] & MSGFLAG_READ, $categories); ZLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportPerUserReadStateChange(): read for :'%s'", $this->prefix.bin2hex($readstate["sourcekey"]))); } } diff -Nru z-push-2.4.4/src/lib/core/asdevice.php z-push-2.4.5/src/lib/core/asdevice.php --- z-push-2.4.4/src/lib/core/asdevice.php 2018-07-25 19:42:25.000000000 +0000 +++ z-push-2.4.5/src/lib/core/asdevice.php 2018-11-07 13:46:58.000000000 +0000 @@ -692,7 +692,20 @@ } } if (is_array($this->backend2folderidCache) && isset($this->backend2folderidCache[$backendid])) { - return $this->backend2folderidCache[$backendid]; + // Use cached version only if the folderOrigin matches - ZP-1449 + if (Utils::GetFolderOriginFromId($this->backend2folderidCache[$backendid]) == $folderOrigin) { + return $this->backend2folderidCache[$backendid]; + } + // if we have a different origin, we need to actively search for all synchronized folders, as they might be synched with a different origin + // the short-id is only used if the folder is being synchronized (in contentdata) - else any chached (temporarily) ids are NOT used + else { + foreach ($this->contentData as $folderid => $data) { + if (isset($data[self::FOLDERBACKENDID]) && $data[self::FOLDERBACKENDID] == $backendid) { + ZLog::Write(LOGLEVEL_DEBUG, sprintf("ASDevice->GetFolderIdForBackendId(): found backendid in contentdata but with different folder type. Lookup '%s' - synchronized id '%s'", $folderOrigin, $folderid)); + return $folderid; + } + } + } } // nothing found? Then it's a new one, get and add it diff -Nru z-push-2.4.4/src/lib/core/streamimporter.php z-push-2.4.5/src/lib/core/streamimporter.php --- z-push-2.4.4/src/lib/core/streamimporter.php 2018-07-25 19:42:25.000000000 +0000 +++ z-push-2.4.5/src/lib/core/streamimporter.php 2018-11-07 13:46:58.000000000 +0000 @@ -210,11 +210,12 @@ * * @param string $id * @param int $flags - read/unread + * @param array $categories * * @access public * @return boolean */ - public function ImportMessageReadFlag($id, $flags) { + public function ImportMessageReadFlag($id, $flags, $categories = array()) { if(!($this->objclass instanceof SyncMail)) return false; @@ -228,6 +229,15 @@ $this->encoder->startTag(SYNC_POOMMAIL_READ); $this->encoder->content($flags); $this->encoder->endTag(); + if (!empty($categories) && is_array($categories)) { + $this->encoder->startTag(SYNC_POOMMAIL_CATEGORIES); + foreach($categories as $category) { + $this->encoder->startTag(SYNC_POOMMAIL_CATEGORY); + $this->encoder->content($category); + $this->encoder->endTag(); + } + $this->encoder->endTag(); + } $this->encoder->endTag(); $this->encoder->endTag(); diff -Nru z-push-2.4.4/src/lib/syncobjects/synctaskrecurrence.php z-push-2.4.5/src/lib/syncobjects/synctaskrecurrence.php --- z-push-2.4.4/src/lib/syncobjects/synctaskrecurrence.php 2018-07-25 19:42:25.000000000 +0000 +++ z-push-2.4.5/src/lib/syncobjects/synctaskrecurrence.php 2018-11-07 13:46:58.000000000 +0000 @@ -41,6 +41,7 @@ public $regenerate; public $deadoccur; public $calendartype; + public $firstdayofweek; function __construct() { $mapping = array ( @@ -121,6 +122,21 @@ self::STREAMER_RONOTIFY => true); } + if(Request::GetProtocolVersion() >= 14.1) { + // First day of the calendar week for recurrence. + // FirstDayOfWeek values: + // 0 = Sunday + // 1 = Monday + // 2 = Tuesday + // 3 = Wednesday + // 4 = Thursday + // 5 = Friday + // 6 = Saturday + $mapping[SYNC_POOMTASKS_FIRSTDAYOFWEEK] = array ( self::STREAMER_VAR => "firstdayofweek", + self::STREAMER_CHECKS => array( self::STREAMER_CHECK_ONEVALUEOF => array(0,1,2,3,4,5,6) ), + self::STREAMER_RONOTIFY => true); + } + parent::__construct($mapping); }