Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 28e5603482
Fetching contributors…

Cannot retrieve contributors at this time

executable file 28 lines (23 sloc) 0.799 kb
#!/usr/bin/perl
use strict;
use warnings;
use File::Find::Rule;
my $ROOT = "$ENV{HOME}/Maildir";
my @dirs = File::Find::Rule->directory
->maxdepth(1)
->exec(sub { -d "$_/new" })
->in($ROOT);
my $total = 0;
for my $dir (sort @dirs) {
my $count = File::Find::Rule->file
->maxdepth(2)
->exec(sub { $_[2] =~ m{/(?:new|cur)/} })
->not(File::Find::Rule->name(qr/,\w*S\w*\z/))
->in($dir);
next unless $count;
$total += $count;
$dir =~ s{\Q$ROOT\E}{/INBOX};
$dir =~ tr|.|/|;
printf "%-30s : %u\n", $dir, $count;
}
$total ? (printf "%30s : %u\n", 'total', $total) : (print "no new mail\n");
Jump to Line
Something went wrong with that request. Please try again.