Results 1 to 2 of 2

Thread: [SOLVED] CLI to enumerate all messages in a folder

  1. #1
    fultonj is offline Senior Member
    Join Date
    Feb 2008
    Location
    Easton PA
    Posts
    63
    Rep Power
    7

    Default [SOLVED] CLI to enumerate all messages in a folder

    I need to enumerate all of the messages in a folder via the CLI. So
    far it seems querying MySQL is the only way. I hope I've misread the
    "zmmailbox help" options and someone can show me a better way.

    How far I got via CLI:

    Get my folders (please ignore Contacts/Messages mix I'm working on that):

    [zimbra@zstore1 import]$ zmmailbox -z -m fultonj getAllFolders | grep -i contact
    7 cont 0 6 /Contacts
    38012 mess 0 0 /ContactsTest
    13 cont 0 74 /Emailed Contacts
    64489 mess 0 52 /ITS Contacts
    112975 mess 0 72 /santillr_contacts
    [zimbra@zstore1 import]$

    Want to getMessage for each message in folder 112975. I can see folder
    data:

    [zimbra@zstore1 import]$ zmmailbox -z -m fultonj getFolder 112975
    {
    "id": "112975",
    "name": "santillr_contacts",
    "path": "/santillr_contacts",
    "parentId": "1",
    "flags": null,
    "color": "defaultColor",
    "unreadCount": 0,
    "messageCount": 72,
    "view": "message",
    "url": null,
    "effectivePermissions": null
    }
    [zimbra@zstore1 import]$

    but I can't seem to get a list of messages IDs from the folder that I
    would then call getMessage with. Tried the following:

    [zimbra@zstore1 import]$ zmmailbox -z -m fultonj searchConv 112975 %
    ERROR: mail.NO_SUCH_CONV (no such conversation: 112975)
    [zimbra@zstore1 import]$ zmmailbox -z -m fultonj searchConv 112975 ''
    ERROR: mail.QUERY_PARSE_ERROR (Couldn't parse query: conv:"112975" ())
    [zimbra@zstore1 import]$

    The closest related forum posts I could find were:

    http://www.zimbra.com/forums/install...x-folders.html
    Delete un-read email older the X days
    Folder Backup - How to get a clean list of all folders but the shared ones

    No luck. Please help. Thank you.

  2. #2
    fultonj is offline Senior Member
    Join Date
    Feb 2008
    Location
    Easton PA
    Posts
    63
    Rep Power
    7

    Default

    The command I wanted was:

    zmmailbox -z -m fultonj search -l 72 "in:santillr_contacts"

    Note that I use 72 since that is the messageCount returned by getFolder. If this number isn't specified then I get the default of 25 at a time.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Re-creating the spam training e-mail account
    By richard-hdd in forum Administrators
    Replies: 21
    Last Post: 03-20-2012, 07:34 AM
  2. .pst migration issues
    By jimklein in forum Migration
    Replies: 13
    Last Post: 02-16-2009, 01:55 AM
  3. Error when Using Outlook PST Importer
    By chh in forum Zimbra Connector for Outlook
    Replies: 1
    Last Post: 01-19-2009, 05:20 AM
  4. 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
  •