[BUG] MailMessage/MIMEDocument parsing doesn't work beyond the first level.
lex at cc.gatech.edu
Tue Apr 30 05:21:31 UTC 2002
Ken Causey <ken at ineffable.com> wrote:
[snipped example message]
Excellent. Let's go:
> To demonstrate my first method:
> a body parts second body parts
> returns #(). This method uses MIMEDocument>>parts
Okay. I don't know why. I don't especially care about trying to make
this work. MailMessage>>parts is better.
> To demonstrate my second method:
> a makeMultipart parts second makeMultipart parts first
First, the makeMultiparts are distracting. They do nothing if the
message isn't multipart already, and if the message *isn't* multipart,
it will force them to be! That is undesired.
But the main issue is that your message is actually structured like
b ("forwarded email with attachment)
c (a single-part "multipart" message)
d (an embedded message)
e ("original attachment")
Note that there is an extra layer here. Since it is encoded as a
message, you'll have to decode it with "MailMessage from:" before
proceding further. The following works to extract the attachment:
forwardedMessage := MailMessage from: a parts second parts first
forwardedMessage parts second
> at this point you can keep appending 'makeMultipart parts first' and you
> continue to get back the same exact result. This method uses
In fact, the makeMultipart is more than distracting -- it is increasing
the nesting depth, even as the "parts first" is decreasing it!
Overall, the difficulty is with the difference between a mail message
and its textual representation. Okay I'm stopping now before I get a
More information about the Squeak-dev