-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JMAP: Internal Error on Email/query #2631
Comments
Hello Jason, I think you need to add operator if you use more than one filter parameters. {"methodCalls":[["Email/query",{"calculateTotal":false,"collapseThreads":false,"filter":{"conditions":[{"inMailbox":"9684553c-ef62-4ba6-82a9-0a462228a64c"}],"operator":"OR"},"limit":25,"position":0,"sort":[{"isAscending":false,"property":"receivedAt"}]},"XzT7WA==#1"],"using":["urn:ietf:params:jmap:core","urn:ietf:params:jmap:mail"]} |
I can't reproduce the issue on my local build, which correctly parses and executes the filter you specified:
The internal error in your syslog indicates that the search backend on your system is broken. Are you using Xapian, did you configure it in imapd.conf and did you run squatter to index your mail? You can verify this by running your filter with a text-only search, omitting any other search criteria, e.g.
Depending on the outcome of this operation, we can investigate further why the query isn't working on your system. @zvasilev An OR filter operator with a single argument is redundant (but the query executor will optimize it away). An equivalent filter to the original filter would be e.g.
|
@zvasilev Rereading you comment I now understand that you posted your filter just an example for a FilterOperator. Sorry for the confusion. Still: you don't need the OR operator in your example (but it doesn't hurt either). |
I apologize I was not aware of this extra setup! Once I configured Xapian, added squatter to cyrus.conf, manually ran squatter to do the indexing - it's working as expected. Thank you @rsto for the pointer on that, and again sorry for another issue that turns out to be bad configuration on my end! |
As this was just a configuration problem on my end, please feel free to close I'm more than halfway through implementing JMAP in my webmail client, and it's Having a sorted and paginated query for messages in a mailbox is a HUGE win I'm sure I will submit another issue (or two or more) that turns out to be a |
Great to hear that you got it sorted out! Feel free to post further issues, you can also post on the cyrus mailing list if you have questions. |
Hello!
I'm working on implementing JMAP for my webmail client and while things are going quite well (great work on this!), I ran into an issue today replicating IMAP SEARCH with email/Query. I'm filtering a specific mailbox, with a subject match, and an "after" utcdate requirement.
Request:
Response:
Syslog:
Jan 16 22:44:58 shop cyrus/http[10207]: jmap: _emailsearch_run: Internal Error
Git version:
git checkout at b7f171c197bdcd26e4a8207c67ebad1dd5d7e1af
If there is anything else I can provide to help troubleshoot (or if I am doing something daft) just let me know. Thanks for your time!
The text was updated successfully, but these errors were encountered: