diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-27 22:46:36 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-27 22:46:36 +0100 |
| commit | 6aebf7f92c7a0bdce8e7c8e8049739d70065ec3b (patch) | |
| tree | caaa78ca71e25fe1f4b12d1bea3cefca39d42969 /src/middleware | |
| parent | 92529ff337c51c653ab9efc47e1250e3f5dfb478 (diff) | |
Search for "/" as the delimiter
Diffstat (limited to 'src/middleware')
| -rw-r--r-- | src/middleware/find_mailboxes_compatibility.rs | 8 |
1 files changed, 3 insertions, 5 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())); } } |