1 # Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # Maildirs for now, MH eventually
5 package PublicInbox::MdirReader;
9 sub maildir_each_file ($$;@) {
10 my ($dir, $cb, @arg) = @_;
11 $dir .= '/' unless substr($dir, -1) eq '/';
12 for my $d (qw(new/ cur/)) {
14 opendir my $dh, $pfx or next;
15 while (defined(my $fn = readdir($dh))) {
16 $cb->($pfx.$fn, @arg) if $fn =~ /:2,[A-Za-z]*\z/;