[dev] Re: [cvs] commit: imp/lib/MIME/Viewer pkcs7.php

Michael M Slusarz slusarz at bigworm.colorado.edu
Tue Dec 17 04:29:43 PST 2002


Quoting Mike Cochrane <mike@graftonhall.co.nz>:

| Just to expand on this a bit more. After I have checked the signature on
| a
| message I'm left with a string with the signed data that looks like this:
| 
| Content-Type: multipart/mixed;
|  boundary="------------000900040804010107030005"
| 
| This is a multi-part message in MIME format.
| --------------000900040804010107030005
| Content-Type: text/plain; charset=us-ascii; format=flowed
| Content-Transfer-Encoding: 7bit
| 
| This is the message
| 
| --------------000900040804010107030005
| Content-Type: text/plain;
|  name="attacment.txt"
| Content-Transfer-Encoding: 7bit
| Content-Disposition: inline;
|  filename="attacment.txt"
| 
| This is an attachement
| 
| --------------000900040804010107030005--
| 
| So I do this to it in IMP_MIME_Viewer_pkcs7:
|   require_once HORDE_BASE . '/lib/MIME/Structure.php';
|   $mime_message = MIME_Structure::parseTextMIMEMessage($signed_data);
|   $signPart = $mime_message->getBasePart();
|   var_dump($contents->renderMIMEPart($mime_message, false));
| 
| and all i get is NULL

This is correct (with the current code).  There is currently no support for 
displaying/downloading MIME_Parts when rendered if they can not be viewed 
inline.  A function(s) needs to be written (in 
MIME_Contents::/IMP_Contents::) that will intelligently display 
options/summary to the user in the case of rendering a non-inline Part that 
is not contained in an IMAP_ID.  This second factor is important if we want 
the user to be able to download the attachments, for example, since the 
data will not be available after the page is finished loading (since the 
data to render was only generated by parsing the S/MIME data).  This 
actually can be accomplished fairly easily by using caching, but once again 
this code has not be written yet...

this was the problem i mentioned when i first made the change to rendering 
the content in the PGP viewer.

michael

______________________________________________
Michael Slusarz [slusarz@bigworm.colorado.edu]
The University of Colorado at Boulder


More information about the dev mailing list