JMAP Email/query Sorting by receivedAt Not Working #1216
Unanswered
mudasir477
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Which client are you using to build the requests? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using Stalwart Mail Server with JMAP to retrieve emails from my inbox. I want to sort emails by receivedAt in descending order so that the latest emails appear at the top. However, regardless of whether I set "isAscending": true or "isAscending": false, the response remains the same (unsorted).
JMAP Request Body
{
"using": [
"urn:ietf:params:jmap:core",
"urn:ietf:params:jmap:mail",
"urn:ietf:params:jmap:submission",
"urn:ietf:params:jmap:vacationresponse",
"urn:ietf:params:jmap:sieve",
"urn:ietf:params:jmap:blob",
"urn:ietf:params:jmap:quota",
"urn:ietf:params:jmap:websocket"
],
"methodCalls": [
[
"Email/query",
{
"accountId": "dp",
"filter": {
"inMailbox": "a"
},
"sort": [
{
"property": "receivedAt",
"isAscending": false
}
],
"collapseThreads": true,
"position": 0,
"limit": 1000,
"calculateTotal": true
},
"0"
],
[
"Email/get",
{
"accountId": "dp",
"#ids": {
"resultOf": "0",
"name": "Email/query",
"path": "/ids"
},
"properties": [
"messageId",
"attachments",
"threadId",
"mailboxIds",
"keywords",
"hasAttachment",
"from",
"to",
"subject",
"receivedAt",
"size",
"preview",
"cc",
"bcc",
"bodyValues"
],
"fetchTextBodyValues": true,
"fetchHTMLBodyValues": true
},
"1"
]
]
}
What I Have Tried
Expected Behavior
Sorting should work as expected when "isAscending": false, displaying newest emails first.
Actual Behavior
The response remains in the same order, regardless of the sorting parameter.
Questions
Any guidance on this issue would be greatly appreciated. Thanks! 🙌
Beta Was this translation helpful? Give feedback.
All reactions