[Dovecot] Order of emails

Timo Sirainen tss at iki.fi
Sat Dec 10 22:20:53 EET 2005


On Fri, 2005-12-09 at 14:14 +0000, Marcus Don wrote:
> We have an issue regarding the order in which emails are displayed in an
> imap folder, which our customers regularly complain about. By default,
> emails are returned from a folder in the order in which they were placed
> into the folder, which makes perfect sense. However, if an email is moved
> into another folder, it will always appear at the top, no matter how old it
> is.

Many IMAP clients show the emails sorted by messages' unique ID number
by default. The UID is always growing, so when copying mail to another
mailbox, it always gets the highest UID.

Messages have two timestamps. One is "received time" or "internaldate"
as IMAP likes to call it. This timestamp is preserved while copying the
message, and this is what IMAP clients should using for sorting.

Another date is the "Date" header in the message itself, but since it
can be faked it's usually better to sort by the received time instead.

In any case, the timestamp in mail's filename has nothing to do with how
clients see the mail sorted.

Received time is stored in file's timestamp. If it changes while
copying, it's a bug. But it worked just fine with me when I just tried.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20051210/98a05a2d/attachment.pgp


More information about the dovecot mailing list