We're looking at integrating Zimbra into our CRM system. I'd like to be able to query Zimbra for all email messages to or from a customer.

Is there an API, soap or rest, that would quickly let me retrieve all messages in Zimbra that were to or from a given email address? The query would have to fetch messages across all Zimbra users, regardless of whose mail folder the message was in.

Performance is important here. It would have to be an indexed search.