use crate::cmd::{open_submaildir, MailStorage}; use crate::de_jmhoffmann_jwebmail_mailstorage::Call_Remove; pub fn remove( ms: &MailStorage, call: &mut dyn Call_Remove, folder: String, mid: String, ) -> varlink::Result<()> { if let Some(p) = ms.maildir_path.read().unwrap().clone() { let md = open_submaildir(p, &folder); md.delete(&mid).map_err(varlink::map_context!())?; call.reply() } else { call.reply_not_initialized() } }