- open my $fh, '<', $file or die "open($file) failed: $!";
- my $orig = do { local $/; <$fh> };
- my $mime = PublicInbox::MIME->new(\$orig);
- my $mids = mids($mime->header_obj);
- find_mid($_) for (@$mids); # populates $found
- my $cid = content_id($mime);
- my $to_edit = $found->{$cid};
+ my $eml = eml_from_path($file) or die "open($file) failed: $!";
+ my $mids = mids($eml);
+ find_mid($found, $_, \@ibxs) for (@$mids); # populates $found
+ my $chash = content_hash($eml);
+ my $to_edit = $found->{$chash};