diff --git a/ChangeLog b/ChangeLog index c454bc0..5dbaafa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ version 3.009: + Improvements: + - for file-per-message based folders, you can now address the message + via its filename. rt.cpan.org#132823 [Alexander Adolf] + version 3.008: Fri 4 Oct 08:34:32 CEST 2019 Fixes: diff --git a/lib/Mail/Box/Dir.pm b/lib/Mail/Box/Dir.pm index c1db22c..3955f96 100644 --- a/lib/Mail/Box/Dir.pm +++ b/lib/Mail/Box/Dir.pm @@ -166,7 +166,19 @@ sub folderToDirectory($$) $dir; } -#------------------------------------------- +sub storeMessage($) +{ my ($self, $message) = @_; + $self->SUPER::storeMessage($message); + my $fn = $message->filename or return $message; + $self->{MBD_by_fn}{$fn} = $message; +} + +=method messageInFile $filename +Returns the folder message which is found the indicated C. This +may be useful when some external tool reports filename to be opened. +=cut + +sub messageInFile($) { $_[0]->{MBD_by_fn}{$_[1]} } =method readMessageFilenames $directory