in reply to Re^7: How to parse outlook type attachment from inbox
in thread How to parse outlook type attachment from inbox
I think you're overcomplicating this problem. So here's my final attempt to explain it to you.
MIME messages are hierarchical in nature. That is to say, a MIME message can contain other MIME messages which can, in turn, also contain other MIME messages and so on. So whatever you use to parse a MIME message, can also be used to parse its children.
In fact, MIME::Parser is cleverer than that, if you set the extract_nested_messages flag to 1 (which is the default value, I'm not sure why you changed it in your code) then it will produce a tree structure containing all of the MIME messages contained within your original message. You can see the structure of this tree with the dump_skeleton method and you can get the children of any given MIME message by using the parts method.
So, you've gone as far as getting the top level message in $entity. If you change the nested messages flag to 1 then your entity will contain sub-entities which you can access using $entity->parts. Each of these contained messages will be a MIME::Entity object and you can extract various parts of the message (like the headers) using the methods described in the documentation.
Is that clearer?
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: How to parse outlook type attachment from inbox
by perlCrazy (Monk) on Sep 26, 2006 at 08:12 UTC |