From 9751fbbf5015bd46dc43d8aa3e4cd99a98405672 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 12 Jul 2026 02:22:44 +0200 Subject: [PATCH] Fix cPanel migration with dangling Maildir symlinks https://github.com/virtualmin/virtualmin-gpl/issues/1251 --- mailboxes/folders-lib.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mailboxes/folders-lib.pl b/mailboxes/folders-lib.pl index 0e35e2b6e..f897771e0 100755 --- a/mailboxes/folders-lib.pl +++ b/mailboxes/folders-lib.pl @@ -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)); } }