[imp] cosmetic issue with encrypted messages

Michael M Slusarz slusarz at bigworm.colorado.edu
Wed Dec 18 17:08:40 PST 2002


Quoting Jan Schneider <jan@horde.org>:

| It works indeed, many thanks. Are there any technical reasons that you
| can't strip parts from message/rf822 parts?

First, message/rfc822 parts exist to accurately transfer the _exact_ 
contents of a message while embedded in another message.  Nothing should be 
done to the message/rfc822 data once received on the server - e.g. there is 
no transfer decoding, etc.  Thus plucking out parts from within a 
message/rfc822 entity goes against the rationale of the part in the first 
place.

On a technical note - it can't be done simply because of the way the 
MIME_Part library works.  When converting a MIME_Part to a string (via 
toString()), when it reaches a message/rfc822 part it simply dumps all data 
in that part; it does not go through the subparts of the message/rfc822 
part to build the text.  Thus, even if we changed data in one of these 
subparts, those changes would not appear in the message returned from 
toString().

The toString() behavior is like this for 2 reasons.  1: it is the expected 
behavior when you want to _create_ a message/rfc822 part.  For example, in 
mailbox.php when we forward messages in message/rfc822 parts, all we do is 
take the full contents of a message and shove them into a message/rfc822 
part.  We do not break apart the message into its subparts, populate those 
subparts, and then put all those subparts into a message/rfc822 part.  2: 
when building a MIME_Part object from a mail message, it is easiest to 
simply grab the entire text of the part (very easy to do) and stick it in 
the message/rfc822 part.

sorry for the long explanation.

michael

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


More information about the imp mailing list