From 0b9c86328c29fa7a1817983650f4f50783595600 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 1 Oct 2014 16:35:20 +0000 Subject: [PATCH] detect TNEF by either its mime-type or caseinsensitive filename of winmail.dat --- emailadmin/inc/class.emailadmin_imapbase.inc.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/emailadmin/inc/class.emailadmin_imapbase.inc.php b/emailadmin/inc/class.emailadmin_imapbase.inc.php index 7390dc6381..63029c739a 100644 --- a/emailadmin/inc/class.emailadmin_imapbase.inc.php +++ b/emailadmin/inc/class.emailadmin_imapbase.inc.php @@ -1486,9 +1486,8 @@ class emailadmin_imapbase $headerObject['ATTACHMENTS'][$mime_id]['cid'] = $cid; $headerObject['ATTACHMENTS'][$mime_id]['partID']=$mime_id; if (!isset($headerObject['ATTACHMENTS'][$mime_id]['name']))$headerObject['ATTACHMENTS'][$mime_id]['name']=$part->getName(); - if ($headerObject['ATTACHMENTS'][$mime_id]['name']=='winmail.dat' && - ($headerObject['ATTACHMENTS'][$mime_id]['mimeType']=='application/octet-stream' || - $headerObject['ATTACHMENTS'][$mime_id]['mimeType']=='application/ms-tnef')) + if (strcasecmp($headerObject['ATTACHMENTS'][$mime_id]['name'],'winmail.dat') || + $headerObject['ATTACHMENTS'][$mime_id]['mimeType']=='application/ms-tnef') { $tnefResolved=false; $tnef_data = $this->getAttachment($headerObject['ATTACHMENTS'][$mime_id]['uid'],$headerObject['ATTACHMENTS'][$mime_id]['partID'],0,false); @@ -4866,7 +4865,7 @@ class emailadmin_imapbase //error_log(__METHOD__.' ('.__LINE__.') '.' Uid:'.$uid.' Part:'.$_partID.'->'.$mime_id.':'.array2string($attachment)); //typical winmail.dat attachment is //Array([size] => 1462762[filename] => winmail.dat[mimeType] => application/ms-tnef[uid] => 100[partID] => 2[name] => winmail.dat) - if ($resolveTNEF && $attachment['mimeType']=='application/ms-tnef') + if ($resolveTNEF && ($attachment['mimeType']=='application/ms-tnef' || !strcasecmp($attachment['name'],'winmail.dat'))) { $tnefParts[] = $attachment; }