Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Help: Need a REST URL to return all emails (all folders) matching search criteria

  1. #11
    Join Date
    Jul 2006
    Location
    Australia, ACT
    Posts
    197
    Rep Power
    9

    Question Is it possible to search all Zimbra accounts on a server?

    I would like to query all Zimbra accounts (or at least a single @domain) on a Zimbra server.

    For example: To locate *all* emails sent / received with an important customer and display this as a RSS feed within our CRM.

    Does anyone know know if this is possible or planned in the near future?

    If not, is it worth investigating the interface directly with Lucene to run this type of search?

    Any help appreciated!

  2. #12
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default zmmboxsearch

    Quote Originally Posted by greenrenault View Post
    I would like to query all Zimbra accounts (or at least a single @domain) on a Zimbra server.

    For example: To locate *all* emails sent / received with an important customer and display this as a RSS feed within our CRM.

    Does anyone know know if this is possible or planned in the near future?
    The zmmboxsearch CLI should do this. Check out the relevant wiki page.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  3. #13
    Join Date
    Jul 2006
    Location
    Australia, ACT
    Posts
    197
    Rep Power
    9

    Talking More questions re: Searching emails across the domain

    Quote Originally Posted by dkarp View Post
    The zmmboxsearch CLI should do this. Check out the relevant wiki page.
    Hey DK! That's almost perfect.

    This query works fine for single & multiple mail boxes where I know the user name:
    Code:
    [zimbra@black ~]$  zmmboxsearch -q "in:inbox"  -m bruce@bigbanana.net -d /tmp
    Question 1: Is this interface exposed via the SOAP / REST URL API? Ideally, I want to architect another system querying Zimbra and if this API already exists (as indicated below), then are there any examples of how it can be called?

    Question 2: When I try to query ALL mail boxes as follows, I receive an error as shown below. Any clues as what could be the cause (& suggested solution)?

    Code:
    [zimbra@black ~]$  zmmboxsearch -q "in:inbox"  -m * -d /tmp
    Code:
    Caught ServiceException: com.zimbra.common.service.ServiceException: system failure: Error parsing MailboxID specifier: bigbanana.net.crt
    com.zimbra.common.service.ServiceException: system failure: Error parsing MailboxID specifier: bigbanana.net.crt
            at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:175)
            at com.zimbra.cs.service.util.ParseMailboxID.parseForceRemote(ParseMailboxID.java:83)
            at com.zimbra.cs.network.cmbsearch.CrossMailboxSearch$CLI.run(CrossMailboxSearch.java:427)
            at com.zimbra.cs.network.cmbsearch.CrossMailboxSearch.main(CrossMailboxSearch.java:318)
    Caused by: java.lang.NumberFormatException: For input string: "bigbanana.net.crt"
            at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
            at java.lang.Integer.parseInt(Integer.java:447)
            at java.lang.Integer.parseInt(Integer.java:497)
            at com.zimbra.cs.service.util.ParseMailboxID.<init>(ParseMailboxID.java:254)
            at com.zimbra.cs.service.util.ParseMailboxID.parseForceRemote(ParseMailboxID.java:81)

  4. #14
    Join Date
    Sep 2005
    Posts
    93
    Rep Power
    10

    Default

    Quote Originally Posted by greenrenault View Post
    Question 2: When I try to query ALL mail boxes as follows, I receive an error as shown below. Any clues as what could be the cause (& suggested solution)?

    Code:
    [zimbra@black ~]$  zmmboxsearch -q "in:inbox"  -m * -d /tmp
    I suspect you need to shell quote the *, ie:

    Code:
    $zmmboxsearch -q "in:inbox" -m "*"
    Bugzilla - Wiki - Downloads - Before posting... Search!

  5. #15
    Join Date
    Jul 2006
    Location
    Australia, ACT
    Posts
    197
    Rep Power
    9

    Talking Search is unbelievably AWESOME!

    Quote Originally Posted by tim brennan View Post
    I suspect you need to shell quote the *, ie:

    Code:
    $zmmboxsearch -q "in:inbox" -m "*"
    Wow, that is just SOOO COOL!

    My next question was how do I return more than 25 results in a search query, but I found the answer here. So to search ALL mail boxes on a server and return a MAXIMUM of 500 results (instead of the default 25) use this syntax:
    Code:
    $  zmmboxsearch -q "from:@zimbra.com" -m "*" -d /tmp/search -l 500
    That is fantastic, thanks for your help! Any chance we can get more examples and explanations on the Wiki page?

    Cheers!

  6. #16
    Join Date
    Jan 2007
    Location
    Minnesota
    Posts
    719
    Rep Power
    9

    Default

    Editing my post to say never mind; I got https://example.com/service/home/ric...esome&fmt=atom to work. Quoting issue.

    Any follow up on the original query in this thread?

    I wanted to demo pulling down a bunch of blogs via RSS, marking certain blog entries as well as email messages in various folders as "Awesome," and re-exporting them from Zimbra with a URL like https://example.com/service/home/ric...ome%22&fmt=rss

    but it doesn't work.

    Oh well. The demo is pretty damn awesome regardless.
    Last edited by Rich Graves; 05-20-2007 at 09:27 AM.

  7. #17
    Join Date
    Apr 2008
    Posts
    4
    Rep Power
    7

    Default

    This is perfect it is exactly what I am lookign for and will start to test it but before I leap in will this also search emails that have been archived too?

  8. #18
    Join Date
    Aug 2007
    Location
    outside Philadelphia
    Posts
    214
    Rep Power
    8

    Default

    running the "zmmboxsearch" with the wildcard for accounts, gives me an error message.... not sure why, trying a few different permutations....

    zmmboxsearch -q "searchme" -m "*" -d /var/tmp
    [] WARN: Unable to (com.zimbra.common.soap.SoapFaultException: invalid request: missing required attribute: id
    ExceptionId:btpool0-7803:1225826649997:f53072efc65361cc
    Code:service.INVALID_REQUEST) fetch search results from remote server ProxyTarget(url=https://host.domain.com:7071/service/admin/soap/SearchMultiMailboxRequest)

Similar Threads

  1. [SOLVED] Searching message headers?
    By gkra in forum Users
    Replies: 2
    Last Post: 08-11-2007, 09:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •