melib/collection: ensure mailbox exists when inserting new envelopes
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This commit is contained in:
parent
567270e177
commit
fb5a88c22c
1 changed files with 4 additions and 0 deletions
|
@ -365,6 +365,10 @@ impl Collection {
|
|||
|
||||
pub fn insert(&self, envelope: Envelope, mailbox_hash: MailboxHash) -> bool {
|
||||
let hash = envelope.hash();
|
||||
|
||||
// Ensure mailbox exists in collection.
|
||||
self.new_mailbox(mailbox_hash);
|
||||
|
||||
self.mailboxes
|
||||
.write()
|
||||
.unwrap()
|
||||
|
|
Loading…
Add table
Reference in a new issue