X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FMsgIter.pm;h=bb1dfeadc291857f993b68dd297da46de3a9728c;hb=0d38f65c490466837ae091afa7a7b6f59d04ce7c;hp=cd5a5d99564e9d05c100d521677ca7d62c9deb4f;hpb=8d1b87f498ea47bb752ea24900372df192d322fb;p=public-inbox.git diff --git a/lib/PublicInbox/MsgIter.pm b/lib/PublicInbox/MsgIter.pm index cd5a5d99..bb1dfead 100644 --- a/lib/PublicInbox/MsgIter.pm +++ b/lib/PublicInbox/MsgIter.pm @@ -20,19 +20,21 @@ sub em_each_part ($$;$$) { my $i = 0; @parts = map { [ $_, 1, ++$i ] } @parts; while (my $p = shift @parts) { - my ($part, $depth, @idx) = @$p; + my ($part, $depth, $idx) = @$p; my @sub = $part->subparts; if (@sub) { $depth++; $i = 0; - @sub = map { [ $_, $depth, @idx, ++$i ] } @sub; + @sub = map { + [ $_, $depth, "$idx.".(++$i) ] + } @sub; @parts = (@sub, @parts); } else { $cb->($p, $cb_arg); } } } else { - $cb->([$mime, 0, 0], $cb_arg); + $cb->([$mime, 0, 1], $cb_arg); } } @@ -62,8 +64,12 @@ sub msg_part_text ($$) { # times when it should not have been: # <87llgalspt.fsf@free.fr> # <200308111450.h7BEoOu20077@mail.osdl.org> + # But also do not try this with ->{is_submsg} (message/rfc822), + # since a broken multipart/mixed inside a message/rfc822 part + # has not been seen in the wild, yet... if ($err && ($ct =~ m!\btext/\b!i || - $ct =~ m!\bmultipart/mixed\b!i)) { + (!$part->{is_submsg} && + $ct =~ m!\bmultipart/mixed\b!i) ) ) { my $cte = $part->header_raw('Content-Transfer-Encoding'); if (defined($cte) && $cte =~ /\b7bit\b/i) { $s = $part->body;