On my server (dovecot 1.1) the ARRIVE sorting is 80% faster,
but for folder with 7k messages it's only 0.01 sec.

Do you use dovecot's deliver? I asked Timo how dovecot handles ARRIVE and DATE sorting when creating indexes. In some situations you may have unindexed folders (for instance, when not using deliver), and im wondering how the difference is then. You could test this by removing all indexes for the 7k folder you have and issuing both commands. 


It should be trivial to add a user-configurable option in roundcube to  
allow sorting by arrival date. Id be more than happy to make a patch.  
Would this be something of use to RC?

Not so trivial, for database caching you must add column for internal date
(and handle it). Or maybe use message ID would be sufficient?
Other thing is a lack of internal date column on messages list, so
changing sorting order could be confusing. But.... it's possible, so if you
like, create a patch, we'll see.

Ah, I didnt think about database caching. That makes things quite a bit more complicated. 

 Im not sure an internal date column is necessary.  Most of the time emails will appear sorted correctly when just displaying the Date: header as you would now. Once in a while you'd get apparently out-of-order emails (especially spam, but also emails that get delayed on the way), but I think the user-configurable setting explains most of that. We do this currently with squirrelmail and i rarely, if ever, get questions about the sorting display. Squirrelmail does not display the internaldate in the date column afaik.  You think it's necessary to display the internaldate?

Cor