]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MsgIter.pm
rename {pi_config} fields to {pi_cfg}
[public-inbox.git] / lib / PublicInbox / MsgIter.pm
index 7c28d019abc8c7e9fae81c9db2b0196c21e81310..bb1dfeadc291857f993b68dd297da46de3a9728c 100644 (file)
@@ -34,7 +34,7 @@ sub em_each_part ($$;$$) {
                        }
                }
        } else {
-               $cb->([$mime, 0, 0], $cb_arg);
+               $cb->([$mime, 0, 1], $cb_arg);
        }
 }
 
@@ -64,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;