Describe the bug
The uniqueIds returned by the Mailfolder.Sort are always sorted in ascending order and not in the order they were sent by the server.
To Reproduce
Use mailfolder.Sort to get the sorted Uid list:
var uniqueIds = mailfolder.Sort(SearchQuery.All, new List<OrderBy> { OrderBy.ReverseDate });
Expected behavior
Uids should be in the same order as they were sent by the imap server.
Imap log:
C: A00000006 UID SORT (REVERSE DATE) US-ASCII ALL
S: * SORT 13 12 11 10 9 8 7 6 5 4 3 1
S: A00000006 OK UID SORT completed
The sort order is set in the method ImapFolder.Search.SearchMatchesAsync. Maybe it should be set to none if the UntaggedHandlers has a key like "SORT"?
You are correct. Thanks for the bug report!
I'll try to make a new release either late December (week or so after Christmas) or sometime in early January. I probably won't have time until then to make a release.
Most helpful comment
I'll try to make a new release either late December (week or so after Christmas) or sometime in early January. I probably won't have time until then to make a release.