Results 1 to 3 of 3

Thread: grep folder contents

  1. #1
    Join Date
    Jun 2009
    Rep Power

    Default grep folder contents

    I need to search through all the emails in a certain folder for a text string and print the results to a file. On a standard Postfix setup each user would have a /var/spool/mail/username file which I could grep through to accomplish this. How might I do this with Zimbra?



  2. #2
    Join Date
    Feb 2007
    Portland, OR
    Rep Power


    The mail store folder for Postfix in Zimbra is /opt/zimbra/store

    An accounts mailbox ID can be found using the following command:
    zmprov gmi

  3. #3
    Join Date
    Jan 2007
    Rep Power


    Also try zmmailbox -z -m USER "search -t message 'in:inbox secretword'"

    For multiple mailboxes, you can save java startup overhead by piping multiple commands to zmmailbox -z. "sm USER" to set context.

    zmmailbox advantages: uses zimbra indices, so may be faster. Aware of folder structure (there is no way to grep just a certain folder, since folder assignment lives in mysql). Less hacking needed. Finds text that might be obscured by html, quoted-printable, or base64 encoding.

    grep advantages: It's what you know now, and can be used in more creative pipelines. grep supports regular expressions. Due to a design limitation, zmmailbox can't even handle "multiword phrases".

Similar Threads

  1. 'Couldn't access Yahoo! Zimbra Desktop server"
    By chirag1 in forum Error Reports
    Replies: 37
    Last Post: 06-12-2011, 05:14 PM
  2. Can no longer start desktop
    By foobaz in forum General Questions
    Replies: 12
    Last Post: 04-02-2010, 04:06 PM
  3. .pst migration issues
    By jimklein in forum Migration
    Replies: 13
    Last Post: 02-16-2009, 12:55 AM
  4. Error when Using Outlook PST Importer
    By chh in forum Zimbra Connector for Outlook
    Replies: 1
    Last Post: 01-19-2009, 04:20 AM
  5. Replies: 3
    Last Post: 08-11-2007, 12:40 PM

Posting Permissions

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