aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/middleware/find_mailboxes_compatibility.rs10
1 files changed, 6 insertions, 4 deletions
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<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()
}