W.I.P. of new approach for mail winmail.dat attachment handling

- Adopt download_zip to new winmail.dat handling
This commit is contained in:
Hadi Nategh 2015-12-02 14:00:34 +00:00
parent 97d240fcab
commit b9c1ed72ce

View File

@ -2640,9 +2640,25 @@ class mail_ui
$file_list = array();
$dupe_count = array();
$this->mail_bo->reopen($mailbox);
if ($attachments[0]['is_winmail'] && $attachments[0]['is_winmail']!='null')
{
$tnefAttachments = $this->mail_bo->getTnefAttachments($message_id, $attachments[0]['partID'],true);
}
foreach($attachments as $file)
{
if ($file['is_winmail'])
{
// Try to find the right content for file id
foreach ($tnefAttachments as $key => $val)
{
error_log(__METHOD__.' winmail = '.$key);
if ($key == $file['is_winmail']) $attachment = $val;
}
}
else
{
$attachment = $this->mail_bo->getAttachment($message_id,$file['partID'],$file['is_winmail'],false,true);
}
$success=true;
if (empty($file['filename'])) $file['filename'] = $file['name'];
if(in_array($path.$file['filename'], $file_list))