Here's a quick patch for reconstruct.c as of 2.0.16 to use the message
sent time instead of sbuf.mtime for previously-unseen mailboxes. This
fixes a problem (as the comment describes) with outlook using INTERNALDATE
for displaying / sorting messages.

(I might have sent this in once before around the 2.0.5-era. I am upgrading
my server to 2.0.16 and found I had to reimplement it, for what its worth)

[cyrus@marvin ~/src/cyrus-imapd-2.0.16/imap] diff reconstruct.c.orig reconstruct.c
450,451c450,451
<           /* Message file write time is good estimate of internaldate */
<           message_index.internaldate = sbuf.st_mtime;
---
>           /* Flag this to set it after the message is parsed */
>           message_index.internaldate = -1;
462a463,471
>
>           /* Some broken IMAP clients (notably Outlook) use INTERNALDATE as
>                a sort/display key for "Date". Using sbuf.mtime makes it appear
>                to the user as if all the messages in a newly-imported mailbox
>                were sent at the same time (when the message files were written */
>
>       if (message_index.internaldate == -1) {
>           message_index.internaldate = message_index.sentdate;
>         }




  Eric Sorenson - Systems / Network Administrator - Transmeta Corporation


Reply via email to