develooper Front page | perl.pep | Postings from June 2010

Re: Email::MIME walk_parts doesn't walk all my parts

Thread Previous | Thread Next
Ricardo Signes
June 3, 2010 14:22
Re: Email::MIME walk_parts doesn't walk all my parts
Message ID:
* Erik Logtenberg <> [2010-06-03T14:23:52]
> $email->walk_parts(sub {
>     my ($part) = @_;
>     warn($part->content_type . ": " . $part->parts);
> });
> This little snippet is supposed to read an email from stdin and print
> the content-types of all parts (plus the amount of subparts that it has).
> Now for most emails this works fine, but not so for attached email. For
> this email it only sees the first part:

This looks like an incredibly stupid bug based on the incredibly stupid ->parts
method.  Its behavior is really lame.

I'm afraid I don't have a lot more time to look at this right now, but I'd play
around with tweaking walk_parts (in Email::MIME) to use ->subparts instead,
which is a lot saner.

If that fixes this, it's probably a welcome patch.  Thanks for the report.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About