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.
[SOLVED] Searching All Mailboxes / All Emails
-
- Posts: 4
- Joined: Tue May 17, 2016 4:27 am
Re: [SOLVED] Searching All Mailboxes / All Emails
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.
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.
Re: [SOLVED] Searching All Mailboxes / All Emails
6 years later, but yes it did. Thank you!