From a00999023a2e3f67893a751a422c314b40ea5db1 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 17 Oct 2014 13:11:47 +0000 Subject: [PATCH] consider more parts of an email as attachment, even so it may not fully match the needed params. this way, at least we show it in the attachment list --- emailadmin/inc/class.emailadmin_imapbase.inc.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/emailadmin/inc/class.emailadmin_imapbase.inc.php b/emailadmin/inc/class.emailadmin_imapbase.inc.php index 08b76b3a72..4585447659 100644 --- a/emailadmin/inc/class.emailadmin_imapbase.inc.php +++ b/emailadmin/inc/class.emailadmin_imapbase.inc.php @@ -1464,10 +1464,14 @@ class emailadmin_imapbase $part = $mailStructureObject->getPart($mime_id); $partdisposition = $part->getDisposition(); $partPrimaryType = $part->getPrimaryType(); + //error_log(__METHOD__.' ('.__LINE__.') '.' Uid:'.$uid.'->'.$mime_id.' Disp:'.$partdisposition.' Type:'.$partPrimaryType); $cid = $part->getContentId(); if (empty($partdisposition) && $partPrimaryType != 'multipart' && $partPrimaryType != 'text') { - $partdisposition=($partPrimaryType == 'image'&&!empty($cid)?'inline':'attachment'); + // the presence of an cid does not necessarily indicate its inline. it may lack the needed + // link to show the image. Considering this: we "list" everything that matches the above criteria + // as attachment in order to not loose/miss information on our data + $partdisposition='attachment';//($partPrimaryType == 'image'&&!empty($cid)?'inline':'attachment'); } if ($mime_type=='message/rfc822') { @@ -4847,6 +4851,14 @@ class emailadmin_imapbase //error_log(__METHOD__.' ('.__LINE__.') '.' Uid:'.$uid.'->'.$mime_id.':'.array2string($part->contentTypeMap())); foreach($part->contentTypeMap() as $sub_id => $sub_type) if ($sub_id != $mime_id) $skipParts[$sub_id] = $sub_type; } + if (empty($partDisposition) && $partPrimaryType != 'multipart' && $partPrimaryType != 'text') + { + // the absence of an partDisposition does not necessarily indicate there is no attachment. it may be an + // attachment with no link to show the attachment inline. + // Considering this: we "list" everything that matches the above criteria + // as attachment in order to not loose/miss information on our data + $partDisposition='attachment'; + } //error_log(__METHOD__.' ('.__LINE__.') '.' Uid:'.$uid.' Part:'.$_partID.'->'.$mime_id.':'.array2string($skipParts)); if (array_key_exists($mime_id,$skipParts)) continue;