Skip to content

IMAP: FETCH command only returns first line of each message response #18847

Description

@bohwaz

I did this

curl imaps://imap.example.org:993/INBOX -X 'UID FETCH 1 (BODY.PEEK[TEXT])' -u user:password

I expected the following

I should have received this:

* 1 FETCH (UID 1 BODY[TEXT] {447}
(... 447 bytes of message body ...)
)

(note the final closing parenthesis on the last line)

This is what can be seen by adding -v to the curl command.

But instead curl only returns the first line:

* 1 FETCH (UID 1 BODY[TEXT] {447}

This means that using libcurl with a programming language, I cannot parse the received response for FETCH if it includes any BODY query, eg. BODY.PEEK[HEADER.FIELDS (X-Mailer)] will fail as well.

Of course I can still use the shortcut provided by curl (curl 'imaps://imap.example.org:993/INBOX/;UID=1'), but then it's not the same as doing a FETCH with only the information I need for multiple messages.

curl/libcurl version

8.16.0

operating system

Debian Linux Trixie

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions