Commit 81ad5685 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #69 in ZP/z-push from...

Merge pull request #69 in ZP/z-push from bugfix/ZP-656-warnings-for-signed-emails-in-sent to develop

* commit '8139b02b':
  ZP-656 Only prepend transport headers if they are available. Do not include the newlines to separate the headers from the body, as the data already contains headers and the separating lines. If no transport headers are available in the case of a signed message do not use the signed attachment but let imtoinet() generate the email as it generates the headers by default. See ZP-725 for more information.
parents 0808c2a4 8139b02b
......@@ -795,10 +795,13 @@ class MAPIProvider {
// OL 2013 doesn't show sender and subject for signed emails because the headers are missing
if(isset($message->messageclass) && strpos($message->messageclass, "IPM.Note.SMIME.MultipartSigned") === 0 &&
isset($message->asbody->type) && $message->asbody->type == SYNC_BODYPREFERENCE_MIME) {
ZLog::Write(LOGLEVEL_DEBUG, "Attach the transport message headers to a signed message");
$transportHeaders = array(PR_TRANSPORT_MESSAGE_HEADERS_W);
$messageHeaders = $this->getProps($mapimessage, $transportHeaders);
$message->asbody->data = $messageHeaders[PR_TRANSPORT_MESSAGE_HEADERS] ."\r\n\r\n" . $message->asbody->data;
if (isset($messageHeaders[PR_TRANSPORT_MESSAGE_HEADERS]) && $messageHeaders[PR_TRANSPORT_MESSAGE_HEADERS]) {
ZLog::Write(LOGLEVEL_DEBUG, "Prepend the transport message headers to a signed message");
// the retrieved data already contains headers, so we just prepend the transport headers here
$message->asbody->data = $messageHeaders[PR_TRANSPORT_MESSAGE_HEADERS] . $message->asbody->data;
}
}
return $message;
......@@ -2376,8 +2379,9 @@ class MAPIProvider {
*/
private function imtoinet($mapimessage, &$message) {
// if it is a signed message get a full attachment generated by ZCP
$props = mapi_getprops($mapimessage, array(PR_MESSAGE_CLASS));
if (isset($props[PR_MESSAGE_CLASS]) && $props[PR_MESSAGE_CLASS] && strpos(strtolower($props[PR_MESSAGE_CLASS]), 'multipartsigned')) {
$props = mapi_getprops($mapimessage, array(PR_MESSAGE_CLASS, PR_TRANSPORT_MESSAGE_HEADERS_W));
if (isset($props[PR_MESSAGE_CLASS]) && $props[PR_MESSAGE_CLASS] && strpos(strtolower($props[PR_MESSAGE_CLASS]), 'multipartsigned') &&
isset($props[PR_TRANSPORT_MESSAGE_HEADERS]) && $props[PR_TRANSPORT_MESSAGE_HEADERS]) {
// find the required attachment
$attachtable = mapi_message_getattachmenttable($mapimessage);
mapi_table_restrict($attachtable, MAPIUtils::GetSignedAttachmentRestriction());
......
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