Skip to content

[BUG] Mailbox discovery crashes if folder name contains double quotes (") #327

Description

@stan2021nats

Version

1.6.2

Steps to Reproduce

Connect Bichon to a Dovecot IMAP server.

Create an IMAP folder/mailbox containing literal double quotes in its name, for example: "1234" (with literal double quotes around 1234).

Try to perform remote mailbox discovery (GET /api/v1/list-mailboxes/{account_id}?remote=true or via the GUI).

Issue Description

When performing remote mailbox discovery, Bichon fails and aborts the entire process if it encounters any IMAP folder containing literal double quotes (") in its name.

Instead of completing the discovery of other folders, the process immediately crashes with an ImapCommandFailed error.

Based on the raw error message (provided in the logs section below), the backend seems to send a double-escaped or improperly handled string containing literal backslashes (like "1234") back to the IMAP server during subsequent requests (like STATUS or SELECT). The IMAP server (Dovecot) then rejects the command with NO Mailbox doesn't exist, which in turn crashes the client-side parser.

Screenshots or Logs (optional)

Here is the exact log of the error captured during the discovery failure for the folder "1234":

Generic { message: "No(\n "code: None, info: Some("Mailbox doesn't exist: \\\"1234\\\" (0.001 + 0.000 secs).")",\n)", location: Location { file: "crates/core/src/mailbox/list.rs", line: 168, column: 26, }, code: ImapCommandFailed, }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions