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