Knowledge Base
The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides

|
Obtaining more than 500 search results in Zimbra Collaboration Server (2016074)
Symptoms
For more information, see Zimbra bug 58901.
Purpose
Resolution
zmmboxsearchx tool was developed to work around this limit. It has functionality similar to zmmboxsearch, but there are some usage differences. See the procedure below for specific instructions.To work around the 500 item limit for search results:
- Download the
zmmboxsearchxfile, which is attached to Zimbra bug 43265. - Execute all the commands in this procedure as the
zimbrauser:# su - zimbra - Untar the
zmmboxsearchxpackage in a temporary location (for example, in/tmp):# cd /tmp
# tar zxvf zmmboxsearchx-20100625.tgz
The script is located in the resultingbin/folder. - To view usage information, run the script without arguments:
# ./zmmboxsearchx
zmmboxsearchx: --query is required
zmmboxsearchx: use of --account, --searchdirectory or <userlistfile> is required
zmmboxsearchx: try --help option for more information
Usage:
zmmboxsearchx [options] [<userlistfile> ...]
Options: [*] == Required, [+] == Multiple vals OK, (val) == Default
--query <query_string> [*]query string
--dir <directory> directory to write messages to (no directory)
--account <acct> [+]account to include, comma separated values ok
--exclude <acct> [+]account to exclude, comma separated values ok
--exclude-file <file> [+]file listing accounts to exclude
--searchdirectory <filt> ldap filter to search for accounts
--server <hostname> mailbox server (LC:zimbra_zmprov_default_soap_server)
--limit <num> limit the total number of results returned (25)
--offset <num> offset in hit list to start at (0)
--proc <num> maximum number of child/worker processes to use (4)
--url <url> URL of soap service (LC:...)
--authuser <user> account for authentication (LC:zimbra_ldap_user)
--password <password> password for authuser (LC:zimbra_ldap_password)
--help display a brief help message
--man display the entire man page
--debug [<num>] verbose output useful for debugging
--verbose increase verbosity (increments --debug)
Note: LC:<key> means the default is read from localconfig if possible.
Notes:- The options in bold are useful for this procedure in particular; usage will vary according to your specific scenario, however.
- The default value of 4 for the
procoption is sufficient in most scenarios.
- The options in bold are useful for this procedure in particular; usage will vary according to your specific scenario, however.
- Verify the tool's functionality using a subset of the accounts on your system. After confirming that the tool is functioning correctly, try broadening the search to the widest one you need (that is, possibly applying the
"*"wildcard). - Usage of the
zmmboxsearchxtool differs slightly from the tool which is shipped with the product.
For this procedure, the command line arguments forzmmboxsearchxare:# ./zmmboxsearchx --query "query_string" --account "user_name@domain.com" --dir outputDir
To search for the phrase "customer list" on all accounts, and with a limit of 999999 results, run the command:# ./zmmboxsearchx --query '"customer list"' --account "*" --limit 999999 --dir outputDir
Note: When searching on multiple words as a whole, surround the phrase with double quotes inside and single quotes outside, as shown in this example. - To import the resulting messages into a destination account so that you can read those messages in a mail/web client, you can use the
zmmailboxcommand.
For example:# zmmailbox -z -m mailsearchresults@example.com am "/Inbox" outputDir/ACCOUNT-ID_MAILITEMID
480 (/var/tmp/test.txt)
This adds the email message fileACCOUNT-ID_MAILITEMIDto themailsearchresults@example.comaccount's Inbox folder (the480in the example output above is the message ID assigned to the new message in the database).
Running this command on each mail item in the folder can be a slow process, as the Java environment is set up each time thezmmailboxcommand is called. To alleviate this, script this process by creating azmprovcommand file which can then be fed tozmmailbox.
For example, create a text file namedcmd.txtwhich contains lines similar to:am "/Inbox" /var/tmp/msg1
am "/Inbox" /var/tmp/msg2
am "/Inbox" /var/tmp/msg3
Then run this command to use thecmd.txtfile:# zmmailbox -z -m mailsearchresults@example.com < cmd.txt
The message injection is considerably faster using this method. Once complete, access the mailbox to easily manage the outcome of your search.
Troubleshooting
If you see an error similar to this while executing the script:
SOAPAction: "urn:zimbraAdmin#AuthRequest"<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbraAdmin" /></soap:Header><soap:Body><AuthRequest xmlns="urn:zimbraAdmin"> <name>zimbra</name><password>*****</password></AuthRequest></soap:Body></soap:Envelope>SOAP::Transport::HTTP::Client::send_receive: 500 Can't connect to localhost:7071 (certificate verify failed)Content-Type: text/plainClient-Date: Wed, 07 Dec 2011 19:49:40 GMTClient-Warning: Internal responseCan't connect to localhost:7071 (certificate verify failed)LWP::Protocol::https::Socket: SSL connect attempt failed with unknown errorerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at /opt/zimbra/zimbramon/lib//LWP/Protocol/http.pm line 51.zmmboxsearchx: sleep(3): try#2 soap error: 500 Can't connect to localhost:7071 (certificate verify failed) at ./zmmboxsearchx line 851
This indicates that
PERL_LWP_SSL_VERIFY_HOSTNAME must be set to zero for the script to run. To resolve this issue, prefix the assignment when calling the script.For example:
# PERL_LWP_SSL_VERIFY_HOSTNAME=0 zmmboxsearchx --query '"customer list"' --account "*" --limit 999999 --dir outputDirAdditional Information
zmmboxsearchx script on a store node (that is, with the mailboxd service installed). Otherwise, you might be required to install these libraries via CPAN:Parallel::ForkManagerSOAP::Lite
# cpan Parallel::ForkManager# cpan SOAP::LiteRelated Education
Request a Product Feature
To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.
Actions
KB:
- Updated:
- Categories:
- Languages:
- Product Family:
- Product(s):
- Product Version(s):

