Author Topic: Forcing IMAP sorting on INTERNALDATE ?  (Read 3394 times)

Offline daleg

  • Newbie
  • *
  • Posts: 2
Forcing IMAP sorting on INTERNALDATE ?
« on: December 08, 2006, 02:34:12 PM »

I run a IMAP server which uses a maildir-like message store. In playing around with RC, I noticed that for large folders it took a long time to get a header list and sometimes the server even timed out the request. Investigation indicates that, by default, RC does server sorting by DATE.

DATE means the value of the Date: header in each message. To get this, the IMAP server has to open each message (ergo, file), read it, get the Date: header, and so on for each message in the folder. That's a open/read/close, for each message.

It would be way more efficient to sort on INTERNALDATE instead. This means that all the IMAP server needs to do is stat() each message file. The UID is part of the file's name, and the delivery date is the create time of the file... all which is found through one stat() call to each message file. Obviously, this far faster and I hard coded this into my SVN rev 400 copy of RC, and it's MUCH better.

The question is, is there any way I can configure RC to do INTERNALDATE instead of DATE sorting via main.inc.php ?

TIA
/dale

Offline daashag

  • Full Member
  • ***
  • Posts: 198
Re: Forcing IMAP sorting on INTERNALDATE ?
« Reply #1 on: December 08, 2006, 05:44:45 PM »
How did you do this?

Offline daleg

  • Newbie
  • *
  • Posts: 2
Re: Forcing IMAP sorting on INTERNALDATE ?
« Reply #2 on: December 12, 2006, 04:23:16 PM »
I edited imap.inc to issue always issue INTERNALDATE as the SORT command argument.

This is not the right or preferable way to do it, though. I did it mainly just to see the effect it had on page display speed.

/dale