From 1eb4eb85a7435b7b6221f36bb010cfd26ffcec4b Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sat, 30 May 2026 21:22:38 +0200 Subject: [PATCH] Fix to check empty mail files before opening --- mailboxes/boxes-lib.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailboxes/boxes-lib.pl b/mailboxes/boxes-lib.pl index 6514561f6..5e5b8447e 100755 --- a/mailboxes/boxes-lib.pl +++ b/mailboxes/boxes-lib.pl @@ -2706,12 +2706,12 @@ sub read_mail_file my ($file, $headersonly) = @_; # Open and read the mail file +local @st = stat($file); +return undef if (@st && !$st[7]); &open_as_mail_user(MAIL, $file) || return undef; my $mail = &read_mail_fh(MAIL, 0, $headersonly); close(MAIL); -local @st = stat($file); -return undef if (@st && !$st[7]); $mail->{'file'} = $file; $mail->{'size'} = $st[7]; $mail->{'time'} = $st[9];