From: <lkn...@us...> - 2007-02-26 11:14:45
|
Author: lkneschke Date: Mon Feb 26 12:07:39 2007 New Revision: 23449 URL: http://www.egroupware.org/viewvc?rev=3D3D23449&view=3D3Drev Log: added support for messages containing only attachments (application/..., au= =3D dio/...) Modified: trunk/felamimail/Changelog trunk/felamimail/inc/class.bofelamimail.inc.php trunk/felamimail/inc/class.uiwidgets.inc.php Modified: trunk/felamimail/Changelog URL: http://www.egroupware.org/viewvc/trunk/felamimail/Changelog?rev=3D3D23= 44=3D 9&r1=3D3D23448&r2=3D3D23449&view=3D3Ddiff =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D --- trunk/felamimail/Changelog (original) +++ trunk/felamimail/Changelog Mon Feb 26 12:07:39 2007 @@ -1,3 +1,6 @@ +2007-02-26 Lars Kneschke <l.k...@me...> + * added support for messages containing only attachments (application/...= =3D , audio/...) + 2007-02-16 Lars Kneschke <l.k...@me...> * fix for loosing formating of centering, right-justification, text color= =3D ing and italics when composing from draft * fixed my emailaddress in changelog file Modified: trunk/felamimail/inc/class.bofelamimail.inc.php URL: http://www.egroupware.org/viewvc/trunk/felamimail/inc/class.bofelamima= =3D il.inc.php?rev=3D3D23449&r1=3D3D23448&r2=3D3D23449&view=3D3Ddiff =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D --- trunk/felamimail/inc/class.bofelamimail.inc.php (original) +++ trunk/felamimail/inc/class.bofelamimail.inc.php Mon Feb 26 12:07:39 2007 @@ -559,19 +559,22 @@ $structure =3D3D $_structure; =3D $imapPartIDs =3D3D explode('.',$_partID); - =3D + foreach($imapPartIDs as $imapPartID) { if(!empty($tempID)) { $tempID .=3D3D '.'; } $tempID .=3D3D $imapPartID; - #print "TEMPID: $tempID<br>"; - #_debug_array($structure); + //print "TEMPID: $tempID<br>"; + //_debug_array($structure); if($structure->subParts[$tempID]->type =3D3D=3D3D 'MESSAGE' && $struct= ure-=3D >subParts[$tempID]->subType =3D3D=3D3D 'RFC822' && count($structure->subParts[$tempID]->subParts) =3D3D=3D3D 1 && $structure->subParts[$tempID]->subParts[$tempID]->type =3D3D=3D3D '= MULT=3D IPART' && ($structure->subParts[$tempID]->subParts[$tempID]->subType =3D3D=3D= 3D '=3D MIXED' || $structure->subParts[$tempID]->subParts[$tempID]->subType =3D3D= =3D3D =3D 'REPORT')) { $structure =3D3D $structure->subParts[$tempID]->subParts[$tempID]; + } elseif($tempID =3D3D=3D3D 1) { + // do nothing + // $structure =3D3D $_structure; } else { $structure =3D3D $structure->subParts[$tempID]; } @@ -597,7 +600,6 @@ { // parse message structure $structure =3D3D $this->icServer->getStructure($_uid, true); - #_debug_array($structure); if($_partID !=3D3D '') { $structure =3D3D $this->_getSubStructure($structure, $_partID); } @@ -1378,6 +1380,30 @@ #print "<hr>"; #_debug_array($structure); =3D + // this kind of messages contain only the attachment and no body + if($structure->type =3D3D=3D3D 'APPLICATION' || $structure->type =3D3D= =3D3D 'AU=3D DIO') { + $attachments =3D3D array(); + =3D + $newAttachment =3D3D array(); + $newAttachment['size'] =3D3D $structure->bytes; + $newAttachment['mimeType'] =3D3D $structure->type .'/'. $structure->su= bT=3D ype; + $newAttachment['partID'] =3D3D $structure->partID; + if(isset($structure->cid)) { + $newAttachment['cid'] =3D3D $structure->cid; + } + if(isset($structure->parameters['NAME'])) { + $newAttachment['name'] =3D3D $this->decode_header($structure->paramet= er=3D s['NAME']); + } elseif(isset($structure->dparameters['FILENAME'])) { + $newAttachment['name'] =3D3D $this->decode_header($structure->dparame= te=3D rs['FILENAME']); + } else { + $newAttachment['name'] =3D3D lang("unknown"); + } + =3D + $attachments[] =3D3D $newAttachment; + =3D + return $attachments; + } + =3D // this kind of message can have no attachments if($structure->type =3D3D=3D3D 'TEXT' || =3D ($structure->type =3D3D=3D3D 'MULTIPART' && $structure->subType =3D3= D=3D3D '=3D ALTERNATIVE') || @@ -1419,7 +1445,7 @@ } } =3D - #_debug_array($attachments); exit; + //_debug_array($attachments); exit; return $attachments; =3D } @@ -1440,6 +1466,18 @@ } =3D switch($structure->type) { + case 'APPLICATION': + $bodyPart =3D3D array( + array( + 'body' =3D3D> '', + 'mimeType' =3D3D> 'text/plain', + 'charSet' =3D3D> 'iso-8859-1', + ) + ); + =3D + return $bodyPart; + =3D + break; case 'MULTIPART': switch($structure->subType) { case 'ALTERNATIVE': Modified: trunk/felamimail/inc/class.uiwidgets.inc.php URL: http://www.egroupware.org/viewvc/trunk/felamimail/inc/class.uiwidgets.= =3D inc.php?rev=3D3D23449&r1=3D3D23448&r2=3D3D23449&view=3D3Ddiff =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D --- trunk/felamimail/inc/class.uiwidgets.inc.php (original) +++ trunk/felamimail/inc/class.uiwidgets.inc.php Mon Feb 26 12:07:39 2007 @@ -304,8 +304,11 @@ $this->t->set_var('header_subject', @htmlspecialchars('('. lang('no s= =3D ubject') .')', ENT_QUOTES, $this->displayCharset)); } =3D +# _debug_array($header); if($header['mimetype'] =3D3D=3D3D 'multipart/mixed' || =3D - $header['mimetype'] =3D3D=3D3D 'multipart/related') { + $header['mimetype'] =3D3D=3D3D 'multipart/related' || + substr($header['mimetype'],0,11) =3D3D=3D3D 'application' || + substr($header['mimetype'],0,5) =3D3D=3D3D 'audio') { $image =3D3D '<img src=3D3D"'.$GLOBALS['egw']->common->image('felamim= ail'=3D ,'attach').'" border=3D3D"0" style=3D3D"width:12px;">'; $this->t->set_var('attachment_image', $image); } else { |