MailSuite Pro documentation

Messages sorting

By default, messages are sorted by date in reverse order.

The sorting behavior is adjusted in data/settings/modules/Mail.config.json file, MessagesSortBy configuration option. By default, it looks like:

"MessagesSortBy": [
   {
      "Allow": true,
      "List": [],
      "DefaultSortBy": "arrival",
      "DefaultSortOrder": "desc"
   },
   "array"
],

If you set DefaultSortBy to "date" there, the messages will be sorted by sent date rather than message date obtained from IMAP server.

To allow for custom sorting, that needs to be replaced with:

"MessagesSortBy": [
   {
      "Allow": true,
      "List": [
         {
            "SortBy": "arrival",
            "LangConst": "LABEL_SORT_BY_DATE"
         },
         {
            "SortBy": "from",
            "LangConst": "LABEL_SORT_BY_FROM"
         },
         {
            "SortBy": "to",
            "LangConst": "LABEL_SORT_BY_TO"
         }
      ],
      "DefaultSortBy": "arrival",
      "DefaultSortOrder": "desc"
   },
   "array"
],

With the above configuration applied, users will be able to sort the messages by date, sender and recipient.