X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=scripts%2Fimport_maildir;h=f4e8254348ef64f7d258be4473a54ba1d6c54746;hb=e39585ee2bdcbeaab7b6bd33b3568021042d0879;hp=43a8c1aebe26dd5567bfac17ece1c2fad44dbe66;hpb=b12273d68ce08837bd32d483a64b708186d7e94a;p=public-inbox.git diff --git a/scripts/import_maildir b/scripts/import_maildir index 43a8c1ae..f4e82543 100755 --- a/scripts/import_maildir +++ b/scripts/import_maildir @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # Copyright (C) 2014, Eric Wong and all contributors -# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt) +# License: AGPL-3.0+ # # Script to import a Maildir into a public-inbox =begin usage @@ -28,7 +28,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 = Email::Simple->new(do { local $/; <$fh> }); my $date = $s->header('Date'); my $t = eval { str2time($date) }; defined $t or next; @@ -45,7 +45,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::MIME->new(do { local $/; <$fh> }); $im->add($mime); } $im->done;