Results 1 to 3 of 3

Thread: grep folder contents

  1. #1
    cfarinella is offline New Member
    Join Date
    Jun 2009
    Posts
    4
    Rep Power
    6

    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?

    thanks,

    --charlie

  2. #2
    ArcaneMagus's Avatar
    ArcaneMagus is offline Moderator
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    Default

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

    An accounts mailbox ID can be found using the following command:
    Code:
    zmprov gmi user@domain.com

  3. #3
    Rich Graves is offline Outstanding Member
    Join Date
    Jan 2007
    Location
    Minnesota
    Posts
    719
    Rep Power
    9

    Default

    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".

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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, 01:55 AM
  4. Error when Using Outlook PST Importer
    By chh in forum Zimbra Connector for Outlook
    Replies: 1
    Last Post: 01-19-2009, 05: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
  •