* eMail: fix problem when forwarding inline some mails containing winmail.dat attachments (HelpDesk Ticket 3810) (all original attachments are probably part of the winmail.dat, so we resolve the data/attachments contained in winmail.dat)

This commit is contained in:
Klaus Leithoff 2012-08-27 12:14:17 +00:00
parent 846fa9eff9
commit 16de40a9ee

View File

@ -858,6 +858,7 @@
$bofelamimail->openConnection(); $bofelamimail->openConnection();
if (is_array($this->sessionData) && isset($this->sessionData['attachments'])) if (is_array($this->sessionData) && isset($this->sessionData['attachments']))
{ {
$tnfattachments = null;
foreach((array)$this->sessionData['attachments'] as $attachment) { foreach((array)$this->sessionData['attachments'] as $attachment) {
if(is_array($attachment)) if(is_array($attachment))
{ {
@ -874,7 +875,20 @@
break; break;
default: default:
$attachmentData = $bofelamimail->getAttachment($attachment['uid'], $attachment['partID']); $attachmentData = $bofelamimail->getAttachment($attachment['uid'], $attachment['partID']);
if ($attachmentData['type'] == 'APPLICATION/MS-TNEF')
{
if (!is_array($tnfattachments)) $tnfattachments = $bofelamimail->decode_winmail($attachment['uid'], $attachment['partID']);
foreach ($tnfattachments as $k)
{
if ($k['name'] == $attachment['name'])
{
$tnfpart = $bofelamimail->decode_winmail($attachment['uid'], $attachment['partID'],$k['is_winmail']);
$attachmentData['attachment'] = $tnfpart['attachment'];
//error_log(__METHOD__.__LINE__.$k['name'].'<->'.$attachment['name'].':'.array2string($attachmentData['attachment']));
break;
}
}
}
$_mailObject->AddStringAttachment($attachmentData['attachment'], $_mailObject->EncodeHeader($attachment['name']), 'base64', $attachment['type']); $_mailObject->AddStringAttachment($attachmentData['attachment'], $_mailObject->EncodeHeader($attachment['name']), 'base64', $attachment['type']);
break; break;