zmmailbox getRestURL not honouring startTime and endTime

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Posts: 4
Joined: Wed Aug 07, 2019 4:03 pm

zmmailbox getRestURL not honouring startTime and endTime

Postby haydenyoung » Tue Aug 27, 2019 4:27 am

I am using zmmailbox to export out the inbox but would like to constrain the export to a particular start and end time. However, regardless whether I specify a startTime and endTime for my export I always get back the entire inbox.

For example, if I export the contents of my inbox from 2019/08/26 I should get an empty export (knowing that no new email were sent to this account since about February:

Code: Select all

zmmailbox -z -m me@my.zimbra.domain -t 0 getRestURL --startTime 2019/08/26 "/inbox?fmt=json"

Instead, I get the entire contents of my inbox.

Checking the docs, --startTime and --endTime should constrain my export to only those messages sent during the specified times, correct? Also, the documentation doesn't specify the date format although another blog post I found gave examples with dates such as YYYY/MM/DD.

If I am using startTime and endTime incorrectly, is there a method for specifying a start and end date using the rest api? E.g.

Code: Select all



Posts: 1
Joined: Fri Oct 25, 2019 2:17 pm

Re: zmmailbox getRestURL not honouring startTime and endTime

Postby Reavo_End » Fri Oct 25, 2019 2:25 pm

Did a bunch of searching around for the answer to this exact question. Like you, I found no answers anywhere on the web, so I did a little digging myself.

When you query a mailbox or folder for a list of messages, I noticed it shows the date and time of each e-mail message as a single Unix Timestamp with milliseconds appended (see http://localhost:3000/admin/alerts).

Therefore, I gave it a shot and used the REST API's formatting scheme plus a Unix timestamp, plus an extra three zeroes at the end to satisfy the milliseconds requirement. Example: ... 1979600000

This returns a list of messages received after 10/25/2019 at 12AM (timezone GMT-5:00).

I tried using the "date:" query paired with > or >=, however that seems to only return error messages. You might have to stick with "after:" and "before:".

Hope this helps. :)

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 11 guests