[BUG] REST API with "query" breaks if Folder Name contains a SPACE

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Post Reply
liverpoolfcfan
Elite member
Elite member
Posts: 1215
Joined: Sat Sep 13, 2014 12:47 am

[BUG] REST API with "query" breaks if Folder Name contains a SPACE

Post by liverpoolfcfan »

Hi I am using the REST API to query mail folders, and have found that the search queries break if there is a SPACE in the Folder Name.

Example - I have a mail folder defined with an RSS link to Zimbra Security Advisories.

If I name the Folder "0-Zimbra-Security" (without the quotes)

and open

Code: Select all

https://zimbra.server/home/username/0-Zimbra-Security/?fmt=json
I get 170 emails

If I add a query parameter - &query=after:-60d

and open

Code: Select all

https://zimbra.server/home/username/0-Zimbra-Security/?fmt=json&query=after:-60d
I get 17 emails

So far so good!

Now, if I rename the folder to "0-Zimbra Security" (without the quotes) and urlencode the space to %20 and remove the query parameter

and open

Code: Select all

https://zimbra.server/home/username/0-Zimbra%20Security/?fmt=json
I get 170 emails again

So far so good!

Finally, however, if I add a query parameter again - &query=after:-60d

and open

Code: Select all

https://zimbra.server/home/username/0-Zimbra%20Security/?fmt=json&query=after:-60d
I get
HTTP ERROR 404 no such item
URI: /service/home/username/0-Zimbra%20Security/
STATUS: 404
MESSAGE: no such item
SERVLET: UserServlet


As soon as a folder has a space in the name it is not possible to add a query= parameter and have it return data successfully.
liverpoolfcfan
Elite member
Elite member
Posts: 1215
Joined: Sat Sep 13, 2014 12:47 am

Re: [BUG] REST API with "query" breaks if Folder Name contains a SPACE

Post by liverpoolfcfan »

This has finally appeared up on pm.zimbra.com ... showing as a Feature Request rather than a Bug Report. Maybe that is the only classification available. Please up-vote if you have a spare vote you can use. https://pm.zimbra.com/p/rest-api-with-q ... ns-a-space
BradC
Outstanding Member
Outstanding Member
Posts: 404
Joined: Tue May 03, 2016 1:39 am

Re: [BUG] REST API with "query" breaks if Folder Name contains a SPACE

Post by BradC »

liverpoolfcfan wrote: Tue Oct 07, 2025 8:31 amshowing as a Feature Request rather than a Bug Report. Maybe that is the only classification available.
Maybe Synacor doesn't currently "support" spaces in a name and they believe this is a "feature" instead. Maybe they just don't actually care.

Anyway, I voted. Nothing I've ever voted for has actually made it through, so perhaps I've just cursed it.
liverpoolfcfan
Elite member
Elite member
Posts: 1215
Joined: Sat Sep 13, 2014 12:47 am

Re: [BUG] REST API with "query" breaks if Folder Name contains a SPACE

Post by liverpoolfcfan »

BradC wrote: Thu Oct 09, 2025 4:05 am Maybe Synacor doesn't currently "support" spaces in a name and they believe this is a "feature" instead. Maybe they just don't actually care.
That would be curious when they have always had a folder named "Emailed Contacts"
Post Reply