Alexey Melnikov wrote:
5. Formal Syntax The following syntax specification uses the Augmented Backus-Naur Form (ABNF) notation as specified in [RFC5234]. [RFC3501] defines the non-terminals "capability" and "search-key", [RFC4466] defines "search-return-opt", [RFC5256] defines "thread-alg", and [RFC5322] defines "id-left" and "id-right". Except as noted otherwise, all alphabetic characters are case- insensitive. The use of upper or lower case characters to define token strings is for editorial clarity only. Implementations MUST accept these strings in a case-insensitive fashion. capability =/ "SEARCH=INTHREAD" / "THREAD=REFS" search-key =/ "INTHREAD" SP search-key / "MESSAGEID" SP "<" id-left "@" id-right ">"I am not entirely convinced (but I haven't yet checked that '"<" id-left "@" id-right ">"' corresponds to atom IMAP syntax. I think quoted strings/literals would be needed to represent some values.
I am now positive about that:
From RFC 5322:
id-left = dot-atom-text / obs-id-left
id-right = dot-atom-text / no-fold-literal / obs-id-right
dot-atom-text = 1*atext *("." 1*atext)
atext = ALPHA / DIGIT / ; Printable US-ASCII
"!" / "#" / ; characters not including
"$" / "%" / ; specials. Used for atoms.
"&" / "'" /
"*" / "+" /
"-" / "/" /
"=" / "?" /
"^" / "_" /
"`" / "{" /
"|" / "}" /
"~"
"{" and "}" are not allowed in IMAP atom:
atom = 1*ATOM-CHAR
ATOM-CHAR = <any CHAR except atom-specials>
atom-specials = "(" / ")" / "{" / SP / CTL / list-wildcards /
quoted-specials / resp-specials
/ "THREADROOT" / "THREADLEAF"