[SOLVED] zmmailbox search in folders containing spaces

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
User avatar
gabrieles
Outstanding Member
Outstanding Member
Posts: 233
Joined: Tue Feb 14, 2017 9:40 am

[SOLVED] zmmailbox search in folders containing spaces

Post by gabrieles »

How can I search via cli in a user's folder that contain spaces?

I have two calendars, one spaced and one not spaced

Code: Select all

zmmailbox -z -m gabrieles@XXXXXX.XXX gaf
        Id  View      Unread   Msg Count  Path
----------  ----  ----------  ----------  ----------
...
        10  appo           0        1556  /Calendar
        269 appo           0         179  /Another Calendar
...
...
With a non-spaced name, search givesr no problem, lucene is even case insensitive:

Code: Select all

zmmailbox -z -m gabrieles@XXXXXX.XXX s -t appointment "in:calendar"
num: 25, more: true

        Id  Type   From                  Subject                                             Date
    ------  ----   --------------------  --------------------------------------------------  --------------
 1. 103411  appo   <na>                  XXXXXXXXXXXXXXXXXXXXXXXXXX                          06/21/18 15:00
 2. 103492  appo   <na>                  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX           06/20/18 16:30
 3. 103442  appo   <na>                  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX          06/20/18 14:30
 4. 103436  appo   <na>                  XXXXXXXXXXXXXXXXXX                                  06/20/18 10:30
 5. 103434  appo   <na>                  XXXXXXXXXXXXXXXXXXXXXXXXXXXXX                       06/20/18 11:00
...
...
With a spaced folder name:

Code: Select all

zmmailbox -z -m gabrieles@XXXXXX.XXX s -t appointment "in:another calendar"
ERROR: mail.NO_SUCH_FOLDER (no such folder path: //another)
Tried with quotes, doublequotes, escaping space with \, matching case, none worked...
In this case calendars are personal, not shared, but the same identical issue occurs on shared items
Last edited by gabrieles on Mon Jul 02, 2018 12:08 pm, edited 1 time in total.
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: zmmailbox search in folders containing spaces

Post by phoenix »

The format for that is to use the following: in:"my calendar" - that works fine for me.

An easy way to find the syntax is to start typing the search term in the web ui. Put "in:" in the search box and you'll see a list of folders displayed, select the one you want and there's the exact term you need for the command line.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
User avatar
gabrieles
Outstanding Member
Outstanding Member
Posts: 233
Joined: Tue Feb 14, 2017 9:40 am

Re: zmmailbox search in folders containing spaces

Post by gabrieles »

phoenix wrote:in:"my calendar" - that works fine for me.
An easy way to find the syntax is to start typing the search term in the web ui. Put "in:" in the search box and you'll see a list of folders displayed, select the one you want and there's the exact term you need for the command line.
One of the first try I made was that...

Code: Select all

zmmailbox -z -m gabrieles@XXXXXX.XXX s -t appointment in:"Colleague calendar"
ERROR: mail.NO_SUCH_FOLDER (no such folder path: //Colleague)
edit: just tried it on 8.0.5_P1, 8.6.0_P6, 8.7.11 and 8.8.8_P6, same behaviour
User avatar
ccelis5215
Outstanding Member
Outstanding Member
Posts: 632
Joined: Sat Sep 13, 2014 2:04 am
Location: Caracas - Venezuela
ZCS/ZD Version: 8.8.15.GA.3869.UBUNTU18.64 P12

Re: zmmailbox search in folders containing spaces

Post by ccelis5215 »

gabrieles wrote:
phoenix wrote:in:"my calendar" - that works fine for me.
An easy way to find the syntax is to start typing the search term in the web ui. Put "in:" in the search box and you'll see a list of folders displayed, select the one you want and there's the exact term you need for the command line.
One of the first try I made was that...

Code: Select all

zmmailbox -z -m gabrieles@XXXXXX.XXX s -t appointment in:"Colleague calendar"
ERROR: mail.NO_SUCH_FOLDER (no such folder path: //Colleague)
edit: just tried it on 8.0.5_P1, 8.6.0_P6, 8.7.11 and 8.8.8_P6, same behaviour
Hi, try

Code: Select all

zmmailbox -z -m gabrieles@XXXXXX.XXX s -t appointment 'in:"Colleague calendar"'
ccelis
User avatar
gabrieles
Outstanding Member
Outstanding Member
Posts: 233
Joined: Tue Feb 14, 2017 9:40 am

Re: zmmailbox search in folders containing spaces

Post by gabrieles »

Code: Select all

'in:"Colleague calendar"'
This works finally!
I've tried every lucene query combination, except the double quoting....
Thanks!!!
Post Reply