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.