I am using gmail's IMAP API to search for mails.
I use the 'OR' criteria to search for different keywords. This works well if I go one level only, i.e. something like
'UID SEARCH OR (FROM "[email protected]") (TO "[email protected]")'
however, it does not work when I try a longer expression like
criteria OR criteria OR criteria or criteria
which translates to (as far as I understand the syntax)
'UID SEARCH OR ( OR (FROM "[email protected]") (TO "[email protected]")) ( OR (FROM "[email protected]") (TO "[email protected]"))'
to make it clear I basically want all messages that are either sent from or sent to ANY of a given list of emails
The error I get from the libray is
[ 'A34', 'BAD', 'Could', 'not', 'parse', 'command' ]
any suggestions?