]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MdirReader.pm
imap+nntp: share COMPRESS implementation
[public-inbox.git] / lib / PublicInbox / MdirReader.pm
index 484bf0a8dcee682afc3fded71cb9108cb098ee6d..dbb74d6d9772f85afb5b9b0fc4b4b07e1b61ac60 100644 (file)
@@ -42,9 +42,10 @@ sub maildir_each_file {
                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);
                }
        }
 }