From: Ruben Beltran del Rio Date: Mon, 27 Jan 2025 16:06:54 +0000 (+0100) Subject: Actually check for the command X-Git-Tag: 1.1.0~17 X-Git-Url: https://git.r.bdr.sh/rbdr/olden-mail/commitdiff_plain/a8a71b1901784f672f6b778464506463c4ecb286?ds=sidebyside;hp=b5234d6f3aeb75365269c14bd4f553becaf59b70 Actually check for the command --- diff --git a/src/middleware/find_mailboxes_compatibility.rs b/src/middleware/find_mailboxes_compatibility.rs index 04bc834..b8bd33a 100644 --- a/src/middleware/find_mailboxes_compatibility.rs +++ b/src/middleware/find_mailboxes_compatibility.rs @@ -5,10 +5,12 @@ use log::debug; /// a LIST command. pub fn middleware(input: &[u8]) -> Vec { let command = String::from_utf8_lossy(input); - if let Some(tag) = command.split("FIND MAILBOXES /*").next() { - let replacement = format!("{} LIST \"/INBOX\" \"*\"\r\n", tag.trim()); - debug!("### {replacement}"); - return replacement.into_bytes(); + if command.contains("FIND MAILBOXES /*") { + if let Some(tag) = command.split("FIND MAILBOXES /*").next() { + let replacement = format!("{} LIST \"/INBOX\" \"*\"\r\n", tag.trim()); + debug!("### {replacement}"); + return replacement.into_bytes(); + } } input.to_vec() }