Fix cPanel migration with dangling Maildir symlinks

https://github.com/virtualmin/virtualmin-gpl/issues/1251
This commit is contained in:
Ilia Ross
2026-07-12 02:22:44 +02:00
parent 203a87ff0e
commit 9751fbbf50

View File

@@ -1583,6 +1583,10 @@ if ($folder->{'type'} == 1 || $folder->{'type'} == 3) {
&get_mhdir_files($folder->{'file'});
if ($folder->{'type'} == 1) {
foreach my $sf (glob("\Q$folder->{'file'}\E/.??*")) {
# Skip entries that aren't real Maildirs, e.g. a
# dangling symlink relocated during migration (no
# cur/new to read)
next if (!-d "$sf/cur" || !-d "$sf/new");
push(@files, &get_maildir_files($sf));
}
}