X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=scripts%2Fimport_maildir;h=269f2550fc94591d3ed227485154097671c045c0;hb=21fcd8a37c82c1ef654d402cf592f0c9d803aa26;hp=fbf3f6495d1a54663aff2c9e8fef4762d4fb097a;hpb=3d41aa23f35501ca92aab8aa42980fa73f7fa74f;p=public-inbox.git diff --git a/scripts/import_maildir b/scripts/import_maildir index fbf3f649..269f2550 100755 --- a/scripts/import_maildir +++ b/scripts/import_maildir @@ -11,9 +11,8 @@ =cut use strict; use warnings; -use Email::Simple; use Date::Parse qw/str2time/; -use PublicInbox::MIME; +use PublicInbox::Eml; use PublicInbox::Git; use PublicInbox::Import; sub usage { "Usage:\n".join('', grep(/\t/, `head -n 24 $0`)) } @@ -28,7 +27,7 @@ my @msgs; foreach my $sub (qw(cur new)) { foreach my $fn (glob("$dir/$sub/*")) { open my $fh, '<', $fn or next; - my $s = Email::Simple->new(eval { local $/; <$fh> }); + my $s = PublicInbox::Eml->new(do { local $/; <$fh> }); my $date = $s->header('Date'); my $t = eval { str2time($date) }; defined $t or next; @@ -45,7 +44,7 @@ my $im = PublicInbox::Import->new($git, $name, $email); while (my $ary = pop @msgs) { my $fn = "$dir/$ary->[1]"; open my $fh, '<', $fn or next; - my $mime = PublicInbox::MIME->new(eval { local $/; <$fh> }); + my $mime = PublicInbox::Eml->new(do { local $/; <$fh> }); $im->add($mime); } $im->done;