curl / Mailing Lists / curl-library / Single Mail


Fetching emails via imap without setting the "\Seen" flag (BODY.PEEK)

From: Luca Di Rocco via curl-library <>
Date: Tue, 12 Mar 2019 22:35:20 +0100


I need to fetch the latest emails from a mailbox, via IMAP, without
setting the \Seen flag, which would flag the email as read.
I have tried with several imap URLs, but curl always uses the imap
command ... FETCH <id> BODY[... instead of ... FETCH <id>
RFC 5092 about IMAP URL Scheme always shows BODY.PEEK in all examples.
Is the curl url-imap translation correct or should it be regarded as faulty?

I have also tried with a custom command (-X), but there is no message
returned (I can see messages only with -v option, but there are also
some extra characters).

Can you please help me understand if there is a way to use curl to
fetch an email leaving its status unread?

Thank you and kind regards,
Luca Di Rocco
Received on 2019-03-12