diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-09-24 12:17:32 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-09-24 12:17:32 +0300 |
commit | a1e3f269de2725262a1aff98564db51992091595 (patch) | |
tree | a2758ec9b5ef394d1e595e599067cdd5a78c19cd | |
parent | e556191babcbb773a4744aeded0123a8b21791f4 (diff) |
melib/imap: don't manually check for mailbox permissions
-rw-r--r-- | melib/src/backends/imap.rs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/melib/src/backends/imap.rs b/melib/src/backends/imap.rs index 1358727e..8ef7d940 100644 --- a/melib/src/backends/imap.rs +++ b/melib/src/backends/imap.rs @@ -623,24 +623,8 @@ 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); |