Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/Email/Folder/Maildir.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ sub next_message {
my $what = $self->{_messages} || $self->_what_is_there;

my $file = shift @$what or return;

local *FILE;
open FILE, $file or croak "couldn't open '$file' for reading";
$! = 0; # reset ERRNO to ensure we only exactly test what we intend to below
unless( open FILE, $file ){
# if the file no longer exists, hand over to the next file
return $self->next_message() if $!{ENOENT};
# else complain to the user
croak "couldn't open '$file' for reading: $!";
}
join '', <FILE>;
}

Expand Down