diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-27 17:06:54 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-27 17:06:54 +0100 |
| commit | a8a71b1901784f672f6b778464506463c4ecb286 (patch) | |
| tree | e3491f2e1cebacf50d23f196538fa7f683423171 /src | |
| parent | b5234d6f3aeb75365269c14bd4f553becaf59b70 (diff) | |
Actually check for the command
Diffstat (limited to 'src')
| -rw-r--r-- | src/middleware/find_mailboxes_compatibility.rs | 10 |
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() } |