aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/middleware/find_mailboxes_compatibility.rs8
-rw-r--r--src/proxy.rs4
2 files changed, 6 insertions, 6 deletions
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<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() {