]> git.r.bdr.sh - rbdr/olden-mail/commitdiff
Search for "/" as the delimiter
authorRuben Beltran del Rio <redacted>
Mon, 27 Jan 2025 21:46:36 +0000 (22:46 +0100)
committerRuben Beltran del Rio <redacted>
Mon, 27 Jan 2025 21:46:36 +0000 (22:46 +0100)
src/middleware/find_mailboxes_compatibility.rs
src/proxy.rs

index 7c5cd9200e48f132d80ff4de20a21b78deee2226..af03f7983bf2f05f36eb7edee3548f2bf901e90a 100644 (file)
@@ -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()));
                     }
                 }
 
index 5678db92455dc6b51d726cf89a03c17ddadd9749..176d5f98bc7e60a18b0327024c17725acdf0547c 100644 (file)
@@ -249,7 +249,9 @@ fn handle_client(client_stream: TcpStream, configuration: &Arc<Proxy>) {
                 .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() {