From: Ruben Beltran del Rio Date: Mon, 27 Jan 2025 21:46:36 +0000 (+0100) Subject: Search for "/" as the delimiter X-Git-Tag: 1.1.0~6 X-Git-Url: https://git.r.bdr.sh/rbdr/olden-mail/commitdiff_plain/6aebf7f92c7a0bdce8e7c8e8049739d70065ec3b?ds=sidebyside Search for "/" as the delimiter --- diff --git a/src/middleware/find_mailboxes_compatibility.rs b/src/middleware/find_mailboxes_compatibility.rs index 7c5cd92..af03f79 100644 --- a/src/middleware/find_mailboxes_compatibility.rs +++ b/src/middleware/find_mailboxes_compatibility.rs @@ -50,11 +50,9 @@ impl Middleware for FindMailboxesCompatibility { // Transform IMAPv4 "* LIST" lines to IMAPv3 "* MAILBOX" if line.starts_with("* LIST") { - if let Some(last_slash_pos) = line.rfind('/') { - let mailbox_name = line[(last_slash_pos + 1)..] - .replace('"', "") - .trim(); - return Some(format!("* MAILBOX {mailbox_name}\r")); + if let Some(last_slash_pos) = line.rfind("\"/\"") { + let mailbox_name = line[(last_slash_pos + 1)..].replace('"', ""); + return Some(format!("* MAILBOX {}\r", mailbox_name.trim())); } } diff --git a/src/proxy.rs b/src/proxy.rs index 5678db9..176d5f9 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -249,7 +249,9 @@ fn handle_client(client_stream: TcpStream, configuration: &Arc) { .replace('\t', "\\t"); debug!(">>> {debug_original}"); - debug!("### {debug_final}"); + if debug_original != debug_final { + debug!("### {debug_final}"); + } // Lock the TLS stream and write the data to server match tls_stream_clone.lock() {