Re: [Dovecot] IMAP folders sort order
But I tried to create a fresh account in Dovecot (not migrated from
Courier), and it still shows a intermixed folder order:a list "" *
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Sent"
- LIST (\HasNoChildren) "/" "Drafts"
- LIST (\HasNoChildren) "/" "Trash"
- LIST (\HasNoChildren) "/" "INBOX"
- LIST (\HasNoChildren) "/" "Pub" a OK List completed.
Why does this matter? IMAP does NOT enforce any sort of required
sorting order, and no IMAP client can assume a sort order. So
enforcing a sort order on the server is just a waste of resources.
Just a cosmetic problem, of course. Some IMAP clients do sort folders, others do not, so they show different folder sort order in Dovecot, if migrated from Courier (Courier seems to sort folders, so that the system ones appear first). We just needed a seamless migration.
FWIW, this is completely legal IMAP output also (albeit inefficient):
a list "" *
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Sent"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Drafts"
- LIST (\HasNoChildren) "/" "Trash"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "INBOX"
- LIST (\HasNoChildren) "/" "Pub" a OK List completed.
So, it is legal to even list each folder several times?
michael
WBR, valerius
On Sex, 2013-03-01 at 13:01 +0000, Valery V. Sedletski wrote:
So, it is legal to even list each folder several times?
http://www.dovecot.org/imap-client-coding-howto.html
"LIST reply is very loosely defined. It may be very much out of order. It may even contain duplicates."
Quoting "Valery V. Sedletski" valerius@afterlogic.com:
But I tried to create a fresh account in Dovecot (not migrated from Courier), and it still shows a intermixed folder order:
a list "" *
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Sent"
- LIST (\HasNoChildren) "/" "Drafts"
- LIST (\HasNoChildren) "/" "Trash"
- LIST (\HasNoChildren) "/" "INBOX"
- LIST (\HasNoChildren) "/" "Pub" a OK List completed.
Why does this matter? IMAP does NOT enforce any sort of required sorting order, and no IMAP client can assume a sort order. So enforcing a sort order on the server is just a waste of resources.
Just a cosmetic problem, of course. Some IMAP clients do sort folders, others do not, so they show different folder sort order in Dovecot, if migrated from Courier (Courier seems to sort folders, so that the system ones appear first). We just needed a seamless migration.
Still don't see the relevance to a migration though. If you have
software that assumes that mailboxes are listed in some sort of order,
that is just broken software.
FWIW, this is completely legal IMAP output also (albeit inefficient):
a list "" *
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Sent"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Drafts"
- LIST (\HasNoChildren) "/" "Trash"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "Spam"
- LIST (\HasNoChildren) "/" "INBOX"
- LIST (\HasNoChildren) "/" "Pub" a OK List completed.
So, it is legal to even list each folder several times?
Sure. Just like this is legal IMAP:
a FETCH 1 (UID)
- 2 FETCH (UID 100)
- 3 FETCH (FLAGS (\Seen))
- 1 FETCH (UID 50)
- 1 FETCH (UID 50)
- 1 FETCH (UID 50)
- 2 FETCH (UID 100) a OK FETCH complete
Once again: not efficient, but perfectly acceptable.
michael
participants (3)
-
José Celestino
-
Michael M Slusarz
-
Valery V. Sedletski