Shouldn't normally matter, but if someone runs on a sortm'd range of messages,
the assumption about msgnum ordering breaks down.
} else {
@ARGV == 0 or pod2usage();
chdir("$inbox/new") or die("chdir($inbox/new): $!");
} else {
@ARGV == 0 or pod2usage();
chdir("$inbox/new") or die("chdir($inbox/new): $!");
- @files = getfiles('.');
- }
-
- my %folders = filter_mail($inbox, map { $_->[1] }
+ @files = map { $_->[1] }
+ sort { $a->[0] <=> $b->[0] }
+ map {
+ $st = stat($_) or die("stat($_): $!");
+ [ $st->mtime, $_ ]
+ } getfiles('.');
+
+ @files = map { $_->[1] }
sort { $a->[0] <=> $b->[0] }
map {
if (not ($st = stat($_))) {
sort { $a->[0] <=> $b->[0] }
map {
if (not ($st = stat($_))) {
+ getfiles('.');
+ }
+
+ my %folders = filter_mail($inbox, @files);
$run and %folders and update_dot_folders(\%folders);
$run and %folders and update_dot_folders(\%folders);