[BUG] MailMessage/MIMEDocument parsing doesn't work beyond the
first level.
Ken Causey
ken at ineffable.com
Mon Apr 29 14:31:40 UTC 2002
On Sun, 2002-04-28 at 23:57, Lex Spoon wrote:
> 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
>
OK, that's very interesting as this does work. But this indicates even
more clearly that the MailMessage instances returned as a result of
MailMessage>>parts are apparently not correctly formed, since they are
not functionally equivalent to instantiating an instance manually from
the text using MailMessage class>>from:.
Thanks for this workaround.
Ken Causey (nikos)
More information about the Squeak-dev
mailing list
|