]> git.r.bdr.sh - rbdr/olden-mail/commitdiff
Actually check for the command
authorRuben Beltran del Rio <redacted>
Mon, 27 Jan 2025 16:06:54 +0000 (17:06 +0100)
committerRuben Beltran del Rio <redacted>
Mon, 27 Jan 2025 16:06:54 +0000 (17:06 +0100)
src/middleware/find_mailboxes_compatibility.rs

index 04bc8343a8fe301b5610b7cfe8607ace146a9aba..b8bd33a67969f50cc0dc89feeb7d33dbc99ad29b 100644 (file)
@@ -5,10 +5,12 @@ use log::debug;
 /// a LIST command.
 pub fn middleware(input: &[u8]) -> Vec<u8> {
     let command = String::from_utf8_lossy(input);
 /// a LIST command.
 pub fn middleware(input: &[u8]) -> Vec<u8> {
     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()
 }
     }
     input.to_vec()
 }