I’m trying to retrieve some data from email server via imap protocol(with RB-libcURL). Unfortunately when I run the command UID FETCH NUMID (FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (Message-Id DATE FROM SUBJECT TO SENDER REPLY-TO CC BCC)])
returns
* 1 FETCH (UID 3780 FLAGS (\Answered \Seen) INTERNALDATE "20-Oct-2020 19:50:23 +0200" RFC822.SIZE 158788 BODY[HEADER.FIELDS (MESSAGE-ID DATE FROM SUBJECT TO SENDER REPLY-TO CC BCC)] {220}
but not the content of the email. If I run the same command from terminal I get the same result but if I use the -v option everything works correctly. If instead I use for example the command fetch 1:* (UID FLAGS)
everything works correctly.What am I missing?
curl -v imaps://imap.url.com/INBOX --user "user:pass" -X "UID FETCH 3780 (FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (Message-Id DATE FROM SUBJECT TO SENDER REPLY-TO CC BCC)])"
Var curl As New libcURL.EasyHandle
Call curl.SetOption(libcURL.Opts.SSL_ENABLE_ALPN, False)
Call curl.SetOption(libcURL.Opts.SSL_VERIFYPEER, 0)
Call curl.SetOption(libcURL.Opts.SSL_VERIFYHOST, 0)
Call curl.SetOption(libcURL.Opts.URL, "imaps://imap.url.com/"+cartella)
Call curl.SetOption(libcURL.Opts.USERNAME, "user")
Call curl.SetOption(libcURL.Opts.PASSWORD, "pass")
if _comando <> "" then
Call curl.SetOption(libcURL.Opts.CUSTOMREQUEST, _Comando)
end if
Var mb As New MemoryBlock(0)
var bs as new BinaryStream(mb)
curl.DownloadStream = bs
if curl.Perform then
bs.Close
curl.DownloadStream = Nil
Return mb
else
MsgBox libcURL.FormatError(curl.LastError)
end if