-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# Maildirs for now, MH eventually
use strict;
use v5.10.1;
use PublicInbox::InboxWritable qw(eml_from_path);
-use Digest::SHA qw(sha256_hex);
+use PublicInbox::SHA qw(sha256_hex);
# returns Maildir flags from a basename ('' for no flags, undef for invalid)
sub maildir_basename_flags {
my $pfx = $dir.$d;
opendir my $dh, $pfx or next;
while (defined(my $bn = readdir($dh))) {
- maildir_basename_flags($bn) // next;
+ my $fl = maildir_basename_flags($bn) // next;
next if defined($mod) && !shard_ok($bn, $mod, $shard);
- $cb->($pfx.$bn, @arg);
+ next if index($fl, 'T') >= 0; # no Trashed messages
+ $cb->($pfx.$bn, $fl, @arg);
}
}
}