Skip to content

Commit

Permalink
accees messages by filename
Browse files Browse the repository at this point in the history
  • Loading branch information
markov2 committed Aug 18, 2020
1 parent 6c75363 commit 55df107
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 13 additions & 1 deletion lib/Mail/Box/Dir.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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<filename>. This
may be useful when some external tool reports filename to be opened.
=cut

sub messageInFile($) { $_[0]->{MBD_by_fn}{$_[1]} }

=method readMessageFilenames $directory
Expand Down

0 comments on commit 55df107

Please sign in to comment.