IMAP is both excellent and, annoyingly inconsistent so it's much more of a pain to develop reliable parsers for. I'm pretty happy to use IMAP generally, but I'm also... MODSEQ is wrapped with a () in some places, not but STATUS HIGHESTMODSEQ:
. SELECT INBOX.Archive
* 1239 EXISTS
* 0 RECENT
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen $X-ME-Annot-2 $HasAttachment $IsNotification $IsMailingList $NotJunk $CanUnsubscribe)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $X-ME-Annot-2 $HasAttachment $IsNotification $IsMailingList $NotJunk $CanUnsubscribe \*)] Ok
* OK [UNSEEN 1221] Ok
* OK [UIDVALIDITY 1108730350] Ok
* OK [UIDNEXT 2231] Ok
* OK [HIGHESTMODSEQ 40306873] Ok
* OK [MAILBOXID (210306ee-5833-456b-bede-6d04757128b3)] Ok
* OK [URLMECH INTERNAL] Ok
* OK [ANNOTATIONS 65536] Ok
. OK [READ-WRITE] Completed
. FETCH 1 MODSEQ
* OK [HIGHESTMODSEQ 40306873] CONDSTORE enabled by FETCH MODSEQ
* 1 FETCH (MODSEQ (39570709))
. OK Completed (0.000 sec)
So it is just coincidence that there are zero good IMAP clients out there? I have tried a lot of clients and nobody has managed an implementstion which is works well in practice.
And it is a pretty bad query language compared to something like SQL.
(Source: implemented both serverside and clientside IMAP.)
IMAP is basically a database query language and as such it works as it should.