mirror of
https://github.com/webmin/webmin.git
synced 2026-07-25 02:40:37 +01:00
Fix to count missing Maildirs as empty
https://github.com/virtualmin/virtualmin-gpl/issues/1248
This commit is contained in:
@@ -2507,7 +2507,11 @@ delete($main::list_maildir_cache_time{$dir});
|
||||
# Returns the number of messages in a maildir directory
|
||||
sub count_maildir
|
||||
{
|
||||
local @files = &get_maildir_files($_[0]);
|
||||
my $dir = $_[0];
|
||||
# A missing Maildir is empty until first delivery creates it. If a path
|
||||
# exists, including a dangling symlink, let the normal Maildir open fail.
|
||||
return 0 if (!-e $dir && !-l $dir);
|
||||
local @files = &get_maildir_files($dir);
|
||||
return scalar(@files);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user