[horde] IMP sort by date
Michael M Slusarz
slusarz at horde.org
Thu Aug 24 13:54:16 PDT 2006
Quoting Andrew Morgan <morgan at orst.edu>:
> On Thu, 24 Aug 2006, Chris St. Pierre wrote:
>
>> Hrm, that doesn't seem to make sense either. Here's a snippet from
>> the inbox page in IMP:
>>
>> 2446 09:54:04 AM ...
>> 223 02/21/2002 ...
>> 224 02/21/2002 ...
>> 339 12/31/1903 ...
>> 2445 06:32:26 AM ...
>>
>> I got into my IMAP server (Cyrus, btw) and asked for the INTERNALDATE
>> fields of these five messages. (As an aside, it's remarkably helpful
>> to have the message numbers right there. Thanks, Horde team!) Here's
>> what I got:
>>
>> * 2446 FETCH (INTERNALDATE "24-Aug-2006 09:55:30 -0500")
>> * 223 FETCH (INTERNALDATE "20-Aug-2006 09:32:03 -0500")
>> * 224 FETCH (INTERNALDATE "20-Aug-2006 09:32:03 -0500")
>> * 339 FETCH (INTERNALDATE "20-Aug-2006 09:32:04 -0500")
>> * 2445 FETCH (INTERNALDATE "24-Aug-2006 06:32:34 -0500")
>>
>> As you can see, messages 2445 and 2446 are sorted correctly, but the
>> others all have INTERNALDATEs of several days ago, when we migrated to
>> Cyrus -- they don't have INTERNALDATEs between 6:32 am and 9:55 am
>> today. Why would they be sorted as if they were?
>
> Ha, we had the same sort of thing happen when we migrated from
> UW-IMAP to Cyrus. :) But, everything worked normally after the
> migration. New messages were correctly sorted by arrival time.
>
> Since you run Cyrus, maybe you can turn on the telemetry log for
> this particular person and see the exact IMAP protocol command that
> happens here? From what I can see in the IMP code, it does:
>
> $sorted = imap_sort($imp['stream'], $prefs->getValue('sortby'),
> $prefs->getValue('sortdir'), SE_UID);
>
> So unless the sortby preference is wonky somehow, it should be using
> arrival date...
If I remember correctly, imap_sort() actually does the sorting
internally (i.e. in c-client) instead of on the server. So your issue
might be a buggy version of c-client.
michael
___________________________________
Michael Slusarz [slusarz at horde.org]
More information about the horde
mailing list