[SOLVED] Searching All Mailboxes / All Emails

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
Jazzhands
Posts: 33
Joined: Fri Sep 12, 2014 10:11 pm

[SOLVED] Searching All Mailboxes / All Emails

Post by Jazzhands »

My client suspected some shenanigans by an employee so he asked me to search all accounts/inboxes for a certain string. Here's what I ran:


zmprov gaa |awk '{print "zmmailbox -z -m "$1" search ' |sh -v


This basically prints out each account then runs the search against each account. I figured someone else might be looking for a similar solution. Heck maybe there's an even easier way I overlooked.
gus.hoppes
Posts: 4
Joined: Tue May 17, 2016 4:27 am

Re: [SOLVED] Searching All Mailboxes / All Emails

Post by gus.hoppes »

This didn't work for me. Could be because this post is very old. Anyways, I did get this to work:
zmprov -l gaa |awk '{print "zmmailbox -z -m "$1" search \"SEARCH STRING\" "}' |sh -v

Here, I've added it to pipe all results to a log file.
zmprov -l gaa |awk '{print "zmmailbox -z -m "$1" search \"SEARCH STRING\" "}' |sh -v > /tmp/searchresults.txt 2>&1

Hope this helps someone.
bkrateku
Posts: 1
Joined: Fri Jan 21, 2022 7:24 pm

Re: [SOLVED] Searching All Mailboxes / All Emails

Post by bkrateku »

6 years later, but yes it did. :) Thank you!
Post Reply