IdeaImapServer IMAP search parentheses bug
IdeaImapServer doesn’t recognize parenthesis in IMAP search command.
RFC 3501 is clear:
A search key can also be a parenthesized list of one or more search keys (e.g., for use with the OR and NOT keys).
Please note that RFC document is not talking, if a server SHOULD or MUST support parentheses. It tells that any search key can always be a parenthesized list.
What is worth mentioning, although IMAP search uses polish notation (which doesn’t need parenthesis by itself) IMAP search command syntax actually requires parentheses.
UID SEARCH (OR SUBJECT subject BODY body) – fails, while:
UID SEARCH OR SUBJECT subject BODY body – succeeds.
This is the log from the server minus the authentication (note that 2nd search returns one email):
S: * OK serwer1476502.home.pl IdeaImapServer v0.80 ready
C: 21a04 CAPABILITY
S: * CAPABILITY IMAP4rev1 LITERAL+ CHILDREN I18NLEVEL=1 IDLE SORT UIDPLUS UNSELECT XLIST AUTH=PLAIN AUTH=LOGIN
C: 98104 UID SEARCH (OR SUBJECT subject BODY body)
S: 98104 BAD Unknown argument: (OR SUBJECT subject BODY body
C: 16e37 UID SEARCH OR SUBJECT subject BODY body
S: * SEARCH 1
S: 16e37 OK Completed