diff options
Diffstat (limited to 'lib/MaildirIndexer/Store.pm6')
-rw-r--r-- | lib/MaildirIndexer/Store.pm6 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/MaildirIndexer/Store.pm6 b/lib/MaildirIndexer/Store.pm6 index 5bacbe9..7447643 100644 --- a/lib/MaildirIndexer/Store.pm6 +++ b/lib/MaildirIndexer/Store.pm6 @@ -37,6 +37,12 @@ method del-file(IO $file) { return; } +method mailbox-for-email(MaildirIndexer::Email $email) { + my $id = $email.message-id or return Nil; + with %!mailboxes-for-id{$id} { return .[*-1] } + return Nil; +} + sub mailbox-from-path(Str() $path) { $path ~~ m{'/' (<-[/]>+?) '/' [cur|new|tmp] '/'} and return ~$/[0]; return Nil; |