Author Topic: Case-insensitive sorting of the IMAP folder list  (Read 3462 times)

Offline Dysantic

  • Newbie
  • *
  • Posts: 2
Case-insensitive sorting of the IMAP folder list
« on: November 21, 2013, 01:10:02 PM »
I apologise if this has already been discussed and I've missed it, but I have searched the forums and even scoured through Google to no avail.

With our various installations of RoundCube, the special folder list is at the top and sorted alphabetically (as desired), yet the actual list of IMAP folders for the user seems to be sorted case-sensitively since v0.9.x:

Inbox
Drafts
Sent
Trash
Alpha
Bravo
Charlie
alpha2
bravo2
charlie2

While looking through the code to find out where the sorting takes place (and I'll be the first to admit that I'm rather green at this), it appears that the folder list sorting is using "asort" instead of "natsort". Changing that to "natsort" results in a random (and somewhat amusing) sort order. I've come across some posts on how to fix this, but they're from 6-7 years ago, and don't seem to apply anymore.

How can I change this so the folder list is sorted case-insensitively? The desired output being:

Inbox
Drafts
Sent
Trash
Alpha
alpha2
Bravo
bravo2
Charlie
charlie2

Thanks for your time!

E.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Case-insensitive sorting of the IMAP folder list
« Reply #1 on: November 22, 2013, 02:32:35 AM »
Works for me. It depends on web server system locales (and selected language).

Offline Dysantic

  • Newbie
  • *
  • Posts: 2
Re: Case-insensitive sorting of the IMAP folder list
« Reply #2 on: November 26, 2013, 09:51:14 AM »
Hi Alec,

Thanks for pointing me in the right direction! I had my locale set to en_CA (Canada) and flipped it to en_US as a test, and voila, she works. Not sure why someone thinks that we Canadians hate case-insensitive sorting by default, but there you go.

Kind regards,

E.