From 3102bf88fa3afbc90ee5003c6cfeabb3086a8aaf Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 5 Dec 2014 11:14:42 +0000 Subject: [PATCH] fix problem regarding: uploaded eml files where not handled as message/rfc --- mail/inc/class.mail_compose.inc.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 091dbb3158..0971bfc1f0 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -1616,6 +1616,7 @@ class mail_compose egw_framework::message($e->getMessage(), 'error'); } //error_log(__METHOD__.__LINE__.array2string($tmpFileName)); + //error_log(__METHOD__.__LINE__.array2string($_formData)); if ($eliminateDoubleAttachments == true) { @@ -2152,7 +2153,7 @@ class mail_compose } $_mailObject->setBody($body); } - + //error_log(__METHOD__.__LINE__.array2string($_formData['attachments'])); // add the attachments if (is_array($_formData) && isset($_formData['attachments'])) { @@ -2178,14 +2179,15 @@ class mail_compose $connection_opened = true; } $mail_bo->reopen($attachment['folder']); - switch($attachment['type']) { + switch(strtoupper($attachment['type'])) { + case 'MESSAGE/RFC': case 'MESSAGE/RFC822': $rawHeader=''; if (isset($attachment['partID'])) { $rawHeader = $mail_bo->getMessageRawHeader($attachment['uid'], $attachment['partID'],$attachment['folder']); } $rawBody = $mail_bo->getMessageRawBody($attachment['uid'], $attachment['partID'],$attachment['folder']); - $_mailObject->AddStringAttachment($rawHeader.$rawBody, $attachment['name'], '7bit', 'message/rfc822'); + $_mailObject->addStringAttachment($rawHeader.$rawBody, $attachment['name'], 'message/rfc822'); break; default: $attachmentData = $mail_bo->getAttachment($attachment['uid'], $attachment['partID'],0,false); @@ -2203,7 +2205,7 @@ class mail_compose } } } - $_mailObject->AddStringAttachment($attachmentData['attachment'], $attachment['name'], 'base64', $attachment['type']); + $_mailObject->addStringAttachment($attachmentData['attachment'], $attachment['name'], $attachment['type']); break; } } @@ -2218,10 +2220,9 @@ class mail_compose { $tmp_path = $GLOBALS['egw_info']['server']['temp_dir'].SEP.basename($attachment['file']); } - $_mailObject->AddAttachment ( + $_mailObject->addAttachment ( $tmp_path, $attachment['name'], - strtoupper($attachment['type'])=='MESSAGE/RFC822' ? '7bit' : 'base64', $attachment['type'] ); } @@ -2568,7 +2569,7 @@ class mail_compose #print "
". $mail->getMessageHeader() ."


"; #print "
". $mail->getMessageBody() ."


"; #exit; - +//error_log(__METHOD__.__LINE__.'#'.array2string($_formData['serverID']).'mailaccount>'.array2string($_formData['mailaccount'])); // we use the authentication data of the choosen mailaccount if ($_formData['serverID']!=$_formData['mailaccount']) {