Incorrect sort order when sorting by date

Gavan Fantom gavan at
Mon May 18 07:18:19 EDT 2009

I have been running cyrus imapd for several years now. I recently 
installed roundcube, to provide access to email on those occasions when 
a proper IMAP client isn't available.

Unlike Thunderbird, roundcube relies on IMAP SORT. When sorting by date, 
some emails from the past are presented as newer than the most recent 

There is nothing in the headers which looks particuraly different, and 
those messages are stored in the correct order in the filesystem. The 
timestamp on the messages is consistent with the Date: header.

I verified that this was imapd getting it wrong, using


It returned messages in the same order as roundcube had displayed them.

One of the messages was from March this year (a facebook notification 
message, much the same as many other such messages - there really was 
nothing to stand out about this one) and the other messages were 
periodic updates from another website, spread across the last couple of 
years. Again, there was nothing particularly special that I could see 
about the headers in any of these messages.

I tried running reconstruct on the folder after renaming the 
cyrus.{cache,header,index} files. Suspiciously, it recreated absolutely 
identical files. Perhaps it found the files that I had renamed.

I see that this exact problem has been asked about before:

but there was no reply at the time. I also couldn't find a report about 
this issue in bugzilla.

I am running cyrus imapd 2.2.13 on NetBSD, as installed from pkgsrc.

Does anybody understand what is causing this?

Gillette - the best a man can forget

More information about the Info-cyrus mailing list