/// 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()
}