I'm using zmmailbox to search for matching email messages, like this:

/opt/zimbra/bin/zmmailbox -z -m someone@example.com search -t message "from:Jim\ to:Tim"

This works. (I think the backslash is there to keep Bash happy) The two conditions between the quotation marks are treated like a logical AND, which is understandable.

This retrieves messages from Jim to Tim. I also want messages from Tim to Jim, and I want a lot more messages with specific FROMs and TOs. My question is: Is there a way to specify a logical OR instead of just an AND? I know it's possible to do by just running a command like this many times with different values and merging them together, but it just takes too long.

I would really like to run something like this:

/opt/zimbra/bin/zmmailbox -z -m someone@example.com search -t message "(from:Jim\ to:Tim) or (from:Tim\ to:Jim) or (from:Fred\ to:Tim) or (from:Tim\ to:Fred)"

Or does anyone have any other thoughts? Thanks!

--
Tim