Parsing HTML Email with Inline Images

Hi All,

Has somebody come up with a method of parsing multipart html email
with inline embedded images?

Removing the images as attachments is easy enough, but I'd like to
then embed img tags (Using textile) that relate back to the attachment
so that they remain inline with the body text.

Has thius been done before, or would I be best off using a bunch of
regex and parsing it that way?

Thanks,