From a1e3f269de2725262a1aff98564db51992091595 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Thu, 24 Sep 2020 12:17:32 +0300 Subject: [PATCH] melib/imap: don't manually check for mailbox permissions --- melib/src/backends/imap.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/melib/src/backends/imap.rs b/melib/src/backends/imap.rs index 1358727e0..8ef7d9404 100644 --- a/melib/src/backends/imap.rs +++ b/melib/src/backends/imap.rs @@ -622,25 +622,9 @@ impl MailBackend for ImapType { } let dest_path = { let mailboxes = uid_store.mailboxes.lock().await; - let mailbox = mailboxes - .get(&source_mailbox_hash) - .ok_or_else(|| MeliError::new("Source mailbox not found"))?; - if move_ && !mailbox.permissions.lock().unwrap().delete_messages { - return Err(MeliError::new(format!( - "You are not allowed to delete messages from mailbox {}", - mailbox.path() - ))); - } let mailbox = mailboxes .get(&destination_mailbox_hash) .ok_or_else(|| MeliError::new("Destination mailbox not found"))?; - if !mailbox.permissions.lock().unwrap().create_messages { - return Err(MeliError::new(format!( - "You are not allowed to create messages in mailbox {}", - mailbox.path() - ))); - } - mailbox.imap_path().to_string() }; let mut response = Vec::with_capacity(8 * 1024);