+sub convert_fh ($$$$) {
+ my ($self, $ifmt, $fh, $name) = @_;
+ if ($ifmt eq 'eml') {
+ my $buf = do { local $/; <$fh> } //
+ return $self->{lei}->child_error(1 << 8, <<"");
+error reading $name: $!
+
+ my $eml = PublicInbox::Eml->new(\$buf);
+ $self->{wcb}->(undef, { kw => [] }, $eml);
+ } else {
+ PublicInbox::MboxReader->$ifmt($fh, \&mbox_cb, $self);
+ }
+}
+