[SOLVED] zmmailbox to export emails by date

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
John Kim
Posts: 6
Joined: Sat Sep 13, 2014 1:01 am

[SOLVED] zmmailbox to export emails by date

Post by John Kim »

I'm trying to export emails from a mailbox by date, but keep getting the below error. It appears that the ":" character in the query variable is causing the issue. Any idea how to properly format the date for this query?
[zimbra@mail ~]$ query='before:"1/27/2010" after:"5/29/2009"'

[zimbra@mail ~]$ zmmailbox -z -m test@testtest.com gru "//?fmt=tgz&query=$query" > /tmp/test.tgz
ERROR: zclient.CLIENT_ERROR (unable to parse URI:

https://mail.testtest.com:7071/service/admin/soap/) (cause:

java.net.URISyntaxException Illegal character in query at index 87:

https://mail.testtest.com:443/home/test ... "1/27/2010"

after:"5/29/2009")
Without the date range parameters, the export works without an error.
Regards,

~john
uxbod
Ambassador
Ambassador
Posts: 7811
Joined: Fri Sep 12, 2014 10:21 pm

[SOLVED] zmmailbox to export emails by date

Post by uxbod »

query='before:1/27/2010 after:5/29/2009'works okay.
John Kim
Posts: 6
Joined: Sat Sep 13, 2014 1:01 am

[SOLVED] zmmailbox to export emails by date

Post by John Kim »

Thanks for the reply. It appears that the below does work on version 6, but not for my version (5.016).
[quote user="uxbod"]query='before:1/27/2010 after:5/29/2009'works okay.[/QUOTE]
I had to replace the space with the" %20" and now it works.
query='before:1/27/2010%20after:5/29/2009'
hughgamble
Posts: 1
Joined: Tue May 10, 2022 8:25 pm

Re: [SOLVED] zmmailbox to export emails by date

Post by hughgamble »

In Canada it only works with DD/MM/YYYY
Post Reply