Commit aa08137c authored by Sebastian Kummer's avatar Sebastian Kummer

Merge branch 'develop' of https://stash.z-hub.io/scm/zp/z-push into...

Merge branch 'develop' of https://stash.z-hub.io/scm/zp/z-push into feature/ZP-1065-koe-inject-ldap-signatures-like-webapp
parents 96508ef5 394ceefb
...@@ -64,13 +64,13 @@ Package: z-push-kopano-gabsync ...@@ -64,13 +64,13 @@ Package: z-push-kopano-gabsync
Architecture: all Architecture: all
Depends: ${misc:Depends}, php5-mapi | php7-mapi Depends: ${misc:Depends}, php5-mapi | php7-mapi
Description: GAB sync for Kopano Description: GAB sync for Kopano
Synchronizes a the global address book for the Kopano Outlook Extension Synchronizes the global address book for the Kopano Outlook Extension
Package: z-push-kopano-gab2contacts Package: z-push-kopano-gab2contacts
Architecture: all Architecture: all
Depends: ${misc:Depends}, z-push-common (= ${binary:Version}), php5-mapi | php7-mapi Depends: ${misc:Depends}, z-push-common (= ${binary:Version}), php5-mapi | php7-mapi
Description: GAB sync into a contacts folder for Kopano Description: GAB sync into a contacts folder for Kopano
Synchronizes a the global address book into a contacts folder Synchronizes the global address book into a contacts folder
Package: z-push-ipc-sharedmemory Package: z-push-ipc-sharedmemory
Architecture: all Architecture: all
......
...@@ -1049,16 +1049,16 @@ class BackendIMAP extends BackendDiff implements ISearchProvider { ...@@ -1049,16 +1049,16 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
// We need the text body even though MIME is used, for the preview // We need the text body even though MIME is used, for the preview
$textBody = ""; $textBody = "";
Mail_mimeDecode::getBodyRecursive($message, "html", $textBody, true); Mail_mimeDecode::getBodyRecursive($message, "plain", $textBody, true);
if (strlen($textBody) > 0) { if (strlen($textBody) > 0) {
if ($bpReturnType != SYNC_BODYPREFERENCE_MIME) { if ($bpReturnType != SYNC_BODYPREFERENCE_MIME) {
$bpReturnType = SYNC_BODYPREFERENCE_HTML; $bpReturnType = SYNC_BODYPREFERENCE_PLAIN;
} }
} }
else { else {
Mail_mimeDecode::getBodyRecursive($message, "plain", $textBody, true); Mail_mimeDecode::getBodyRecursive($message, "html", $textBody, true);
if ($bpReturnType != SYNC_BODYPREFERENCE_MIME) { if ($bpReturnType != SYNC_BODYPREFERENCE_MIME) {
$bpReturnType = SYNC_BODYPREFERENCE_PLAIN; $bpReturnType = SYNC_BODYPREFERENCE_HTML;
} }
} }
......
...@@ -828,11 +828,19 @@ class MAPIProvider { ...@@ -828,11 +828,19 @@ class MAPIProvider {
if (!isset($message->importance)) if (!isset($message->importance))
$message->importance = IMPORTANCE_NORMAL; $message->importance = IMPORTANCE_NORMAL;
//TODO contentclass and nativebodytype and internetcpid
if (!isset($message->internetcpid)) $message->internetcpid = (defined('STORE_INTERNET_CPID')) ? constant('STORE_INTERNET_CPID') : INTERNET_CPID_WINDOWS1252; if (!isset($message->internetcpid)) $message->internetcpid = (defined('STORE_INTERNET_CPID')) ? constant('STORE_INTERNET_CPID') : INTERNET_CPID_WINDOWS1252;
$this->setFlag($mapimessage, $message); $this->setFlag($mapimessage, $message);
//TODO checkcontentclass
if (!isset($message->contentclass)) $message->contentclass = DEFAULT_EMAIL_CONTENTCLASS; if (!isset($message->contentclass)) $message->contentclass = DEFAULT_EMAIL_CONTENTCLASS;
if (!isset($message->nativebodytype)) $message->nativebodytype = MAPIUtils::GetNativeBodyType($messageprops);
if (!isset($message->nativebodytype)) {
$message->nativebodytype = MAPIUtils::GetNativeBodyType($messageprops);
}
elseif ($message->nativebodytype == SYNC_BODYPREFERENCE_UNDEFINED) {
$nbt = MAPIUtils::GetNativeBodyType($messageprops);
ZLog::Write(LOGLEVEL_INFO, sprintf("MAPIProvider->getEmail(): native body type is undefined. Set it to %d.", $nbt));
$message->nativebodytype = $nbt;
}
// reply, reply to all, forward flags // reply, reply to all, forward flags
if (isset($message->lastverbexecuted) && $message->lastverbexecuted) { if (isset($message->lastverbexecuted) && $message->lastverbexecuted) {
...@@ -2554,6 +2562,17 @@ class MAPIProvider { ...@@ -2554,6 +2562,17 @@ class MAPIProvider {
$bpo = $contentparameters->BodyPreference($bpReturnType); $bpo = $contentparameters->BodyPreference($bpReturnType);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("bpo: truncation size:'%d', allornone:'%d', preview:'%d'", $bpo->GetTruncationSize(), $bpo->GetAllOrNone(), $bpo->GetPreview())); ZLog::Write(LOGLEVEL_DEBUG, sprintf("bpo: truncation size:'%d', allornone:'%d', preview:'%d'", $bpo->GetTruncationSize(), $bpo->GetAllOrNone(), $bpo->GetPreview()));
// Android Blackberry expects a full mime message for signed emails
// @see https://jira.z-hub.io/projects/ZP/issues/ZP-1154
// @TODO change this when refactoring
$props = mapi_getprops($mapimessage, array(PR_MESSAGE_CLASS));
if (isset($props[PR_MESSAGE_CLASS]) &&
stripos($props[PR_MESSAGE_CLASS], 'IPM.Note.SMIME.MultipartSigned') !== false &&
($key = array_search(SYNC_BODYPREFERENCE_MIME, $bpTypes) !== false)) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("MAPIProvider->setMessageBody(): enforcing SYNC_BODYPREFERENCE_MIME type for a signed message"));
$bpReturnType = SYNC_BODYPREFERENCE_MIME;
}
$this->setMessageBodyForType($mapimessage, $bpReturnType, $message); $this->setMessageBodyForType($mapimessage, $bpReturnType, $message);
//only set the truncation size data if device set it in request //only set the truncation size data if device set it in request
if ( $bpo->GetTruncationSize() != false && if ( $bpo->GetTruncationSize() != false &&
......
...@@ -748,8 +748,12 @@ class Sync extends RequestProcessor { ...@@ -748,8 +748,12 @@ class Sync extends RequestProcessor {
continue; continue;
} }
if (! $sc->GetParameter($spa, "requested")) if (! $sc->GetParameter($spa, "requested")) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync(): partial sync for folder class '%s' with id '%s'", $spa->GetContentClass(), $spa->GetFolderId())); ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync(): partial sync for folder class '%s' with id '%s'", $spa->GetContentClass(), $spa->GetFolderId()));
// reload state and initialize StateMachine correctly
$sc->AddParameter($spa, "state", null);
$status = $this->loadStates($sc, $spa, $actiondata);
}
// initialize exporter to get changecount // initialize exporter to get changecount
$changecount = false; $changecount = false;
......
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
require_once 'vendor/autoload.php'; require_once 'vendor/autoload.php';
if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', 'config.php');
include_once(ZPUSH_CONFIG);
/** /**
* //TODO resync of single folders of a users device * //TODO resync of single folders of a users device
*/ */
...@@ -40,6 +37,10 @@ include_once(ZPUSH_CONFIG); ...@@ -40,6 +37,10 @@ include_once(ZPUSH_CONFIG);
*/ */
define('BASE_PATH_CLI', dirname(__FILE__) ."/"); define('BASE_PATH_CLI', dirname(__FILE__) ."/");
set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI); set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI);
if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', BASE_PATH_CLI . 'config.php');
include_once(ZPUSH_CONFIG);
try { try {
ZPush::CheckConfig(); ZPush::CheckConfig();
ZPushAdminCLI::CheckEnv(); ZPushAdminCLI::CheckEnv();
......
...@@ -28,15 +28,16 @@ ...@@ -28,15 +28,16 @@
require_once 'vendor/autoload.php'; require_once 'vendor/autoload.php';
if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', 'config.php');
include_once(ZPUSH_CONFIG);
/************************************************ /************************************************
* MAIN * MAIN
*/ */
declare(ticks = 1); declare(ticks = 1);
define('BASE_PATH_CLI', dirname(__FILE__) ."/"); define('BASE_PATH_CLI', dirname(__FILE__) ."/");
set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI); set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI);
if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', BASE_PATH_CLI . 'config.php');
include_once(ZPUSH_CONFIG);
try { try {
ZPush::CheckConfig(); ZPush::CheckConfig();
if (!function_exists("pcntl_signal")) if (!function_exists("pcntl_signal"))
......
...@@ -59,7 +59,7 @@ try { ...@@ -59,7 +59,7 @@ try {
require_once 'vendor/autoload.php'; require_once 'vendor/autoload.php';
if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', 'config.php'); if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', BASE_PATH_CLI . 'config.php');
include_once(ZPUSH_CONFIG); include_once(ZPUSH_CONFIG);
ZPush::CheckConfig(); ZPush::CheckConfig();
......
...@@ -46,7 +46,7 @@ try { ...@@ -46,7 +46,7 @@ try {
require_once 'vendor/autoload.php'; require_once 'vendor/autoload.php';
if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', 'config.php'); if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', BASE_PATH_CLI . 'config.php');
include_once(ZPUSH_CONFIG); include_once(ZPUSH_CONFIG);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment