cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Issue with IMAP UID FETCH

From: Dionysios Kalofonos <peitemou_at_gmail.com>
Date: Thu, 08 May 2014 10:21:13 +0300

On 5/7/14, 10:14 PM, Ray Satiro wrote:
> I'll probably keep issuing custom commands because of my requirements.
> With a regular SEARCH I can't get exactly what I want but that's my
> problem. If you're going to make changes to FETCH may I suggest it would
> be helpful if a result even of a custom FETCH were recognized and didn't
> have to be parsed from the header (which maybe is what you are thinking
> about implementing?). For example "FETCH 1 BODY[TEXT]" the actual bytes
> returned would be in the body (what curl recognizes as the body).

Let me list some commands/responses to help ourselves reach a conclusion.

FETCH 1 UID
* 1 FETCH (UID 1)

FETCH 1 ALL
* 1 FETCH (FLAGS (\Seen)
            INTERNALDATE "04-Dec-2012 07:23:55 +0000"
            RFC822.SIZE 955
            ENVELOPE ("Mon, 3 Dec 2012 23:23:55 -0800 (PST)"
                      "Welcome to Yahoo!"
                      (("Yahoo!" NIL "noreply" "yahoo-inc.com"))
                      (("Yahoo!" NIL "noreply" "yahoo-inc.com"))
                      (("Yahoo!" NIL "noreply" "yahoo-inc.com"))
                      ((NIL NIL "example" "yahoo.com"))
                      NIL
                      NIL
                      NIL
                      NIL))

FETCH 1 BODY[TEXT]
* 1 FETCH (FLAGS (\Seen)
            BODY[TEXT] {7390}
<html>
[...]
</html>)

The formatting is mine.

We could return only the response of a FETCH, ie. whatever is within the
outer brackets. Equivalently, we could return only the results of the
remaining IMAP commands for example

SEARCH 1:*
1 2 3 4 5 6 7 8 9 10 11 12

instead of
* SEARCH 1 2 3 4 5 6 7 8 9 10 11 12

But then again we have SELECT/EXAMINE which return
* 12 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1354605835] UIDs valid
* OK [UIDNEXT 2248] Predicted next UID
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded $Junk $NotJunk)
* OK [PERMANENTFLAGS ()] No permanent flags permitted
* OK [HIGHESTMODSEQ 6010850161961900152]

What do we do with that? :)

Kind regards,

-- 
Dionysios Kalofonos
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-05-08