Skip to content

v1: empty encoding in BodyStructure gets serialized as NIL #545

@ptrcnull

Description

@ptrcnull

i assume the encoding should never be specified as an empty string; per RFC 2045:

     encoding := "Content-Transfer-Encoding" ":" mechanism

     mechanism := "7bit" / "8bit" / "binary" /
                  "quoted-printable" / "base64" /
                  ietf-token / x-token

nonetheless, the library accepts this scenario and the resulting BODYSTRUCTURE list cannot be parsed back:

* 11319 FETCH (UID 31137 BODYSTRUCTURE ("text" "plain" () NIL NIL NIL 6002 79 NIL NIL NIL NIL) ENVELOPE ("Sun, 10 Sep 2023 02:00:00 +0000" "acme-update" ((NIL NIL "notify" "ptrc.gay")) ((NIL NIL "notify" "ptrc.gay")) ((NIL NIL "notify" "ptrc.gay")) ((NIL NIL "ptrc" "ptrc.gay")) NIL NIL NIL NIL) FLAGS (\Seen nonjunk \Recent))
in response-data: in body-type-1part: imapwire: expected string, got "N"

Metadata

Metadata

Assignees

No one assigned

    Labels

    non-standardInteroperability with software violating the specs

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions