Commit fdd01b33 authored by mku's avatar mku

ZP-464 #comment BB 10 does not show email body when mail has attachments #time 30m

git-svn-id: https://z-push.org/svn/z-push/trunk@1760 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 0f894448
......@@ -128,13 +128,11 @@ class MAPIProvider {
foreach($rows as $row) {
if(isset($row[PR_ATTACH_NUM])) {
if (isset($row[PR_ATTACH_SIZE]) && $row[PR_ATTACH_SIZE] < MAX_EMBEDDED_SIZE) {
$mapiattach = mapi_message_openattach($mapimessage, $row[PR_ATTACH_NUM]);
$message->picture = base64_encode(mapi_attach_openbin($mapiattach, PR_ATTACH_DATA_BIN));
}
}
}
}
return $message;
}
......@@ -1378,7 +1376,6 @@ class MAPIProvider {
if (isset($contact->picture)) {
$picbinary = base64_decode($contact->picture);
$picsize = strlen($picbinary);
if ($picsize < MAX_EMBEDDED_SIZE) {
$props[$contactprops["haspic"]] = false;
// TODO contact picture handling
......@@ -1420,7 +1417,6 @@ class MAPIProvider {
mapi_savechanges($pic);
}
}
}
if (isset($contact->asbody)) {
$this->setASbody($contact->asbody, $props, $contactprops);
......@@ -2332,28 +2328,23 @@ class MAPIProvider {
}
if (isset($stream) && isset($streamsize)) {
if ($streamsize < MAX_EMBEDDED_SIZE) {
if (Request::GetProtocolVersion() >= 12.0) {
if (!isset($message->asbody))
$message->asbody = new SyncBaseBody();
//TODO data should be wrapped in a MapiStreamWrapper
$message->asbody->data = mapi_stream_read($stream, MAX_EMBEDDED_SIZE);
$message->asbody->data = mapi_stream_read($stream, $streamsize);
$message->asbody->estimatedDataSize = $streamsize;
$message->asbody->truncated = 0;
}
else {
$message->mimetruncated = 0;
//TODO mimedata should be a wrapped in a MapiStreamWrapper
$message->mimedata = mapi_stream_read($stream, MAX_EMBEDDED_SIZE);
$message->mimedata = mapi_stream_read($stream, $streamsize);
$message->mimesize = $streamsize;
}
unset($message->body, $message->bodytruncated);
return true;
}
else {
ZLog::Write(LOGLEVEL_WARN, sprintf("Your request (%d bytes) exceeds the value for inline attachments (%d bytes). You can change the value of MAX_EMBEDDED_SIZE in config.php", $mstreamstat['cb'], MAX_EMBEDDED_SIZE));
}
}
else {
ZLog::Write(LOGLEVEL_ERROR, sprintf("Error opening attachment for imtoinet"));
}
......
......@@ -53,9 +53,6 @@
// Try to set unlimited timeout
define('SCRIPT_TIMEOUT', 0);
// Max size of attachments to display inline. Default is 2 MB
define('MAX_EMBEDDED_SIZE', 2097152);
// When accessing through a proxy, the "X-Forwarded-For" header contains the original remote IP
define('USE_X_FORWARDED_FOR_HEADER', false);
......
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