[BUG] MailMessage/MIMEDocument parsing doesn't work beyond the first level.

Lex Spoon lex at cc.gatech.edu
Mon Apr 29 04:57:41 UTC 2002


Ken Causey <ken at ineffable.com> wrote:
> I've been trying to parse email messages with more than the simplest of
> structures and can't seem to get anywhere.
> 
> VM: Linux 3.2-4743 #1 [oss audio, xshm]
> Image: 3.2gamma-4843
> 
> Consider an example:  Take an email with an attachment, and forward it
> as an attachment.  Diagram:
> 
> a Email
> b   Body
> c   Forwarded Email
> d     Body of Forwarded Email
> e     Attachment
> 
> The problem is that no matter what I do, I can't get to the attachment,
> part e.  


This works for me:

	a := MailMessage from: someText.
	c := MailMessage from: a parts second body content.
	e := c parts second.
	attachmentData := e body content

This seems fairly direct.


Now, MailMessage isn't the cleanest of all cleanly code in the world.  If you
want to clean it up and document your new design, that would be great!

Lex



More information about the Squeak-dev mailing list