Skip to content

v1: serialization of SELECT / FETCH flags allows for empty strings #544

@ptrcnull

Description

@ptrcnull
failed to select mailbox: in response-data: in flag: imapwire: expected atom, got " "

The error originally comes from alps commit 652ea9c7, using go-imap v2.0.0-alpha.6.
Tracing the connection reveals the following exchange:

T4 SELECT INBOX
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft  $Label1 $Label4 $forwarded $label1 \Recent junk nonjunk yeet)

I assume the issue lies in the two spaces between \Draft and $Label1 - however, that's being generated by go-imap v1.2.2-0.20220928192137-6fac715be9cf, running with maddy commit d9920f07.

For the record, RFC 9051 specifies a parenthesized list to be "delimited by space", which might be interpreted ambiguously... but seeing how Thunderbird, Evolution or other mail clients have no issue parsing that response, I imagine it's been assumed that it's valid grammar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions