SORT returns wrong row order

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
rosali
Normal user
Normal user
Posts: 101
Joined: 2008-01-13 18:32

SORT returns wrong row order

Post by rosali » 2011-12-19 07:34

Hi,

If a message has no date header, SORT should use INTERNALDATE (RFC5256).

Below follows a log snippet what really happens.

The message with date 16-Dec-2011 (UID 26) does not have a date header. According to the INTERNALDATE it should be the very last in the row of returned UIDs. But as you see, it is returned as first of the row.

I think this is a bug. If you use Roundcube as Webmail client this behaviour results in wrong message list sorting.

Code: Select all

"IMAPD"	1535560	11860	"2011-12-19 06:18:30.584"	"127.0.0.1"	"RECEIVED: A0007 SORT (DATE) US-ASCII ALL"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.584"	"127.0.0.1"	"SENT: * SORT 26 13 12 11 10 9 8 7 6 5 4 3 2 1 14 15 16 17 18 24 19 20 21 22 23 25[nl]A0007 OK Search completed"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"RECEIVED: A0008 FETCH 26,13,12,11,10,9,8,7,6,5,4,3,2,1,14,15,16,17,18,24,19,20,21,22,23,25 (UID RFC822.SIZE FLAGS INTERNALDATE BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)])"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: * 26 FETCH (UID 30295 RFC822.SIZE 62927 FLAGS (\Seen) INTERNALDATE "16-Dec-2011 13:45:26 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {212}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: * 13 FETCH (UID 24689 RFC822.SIZE 3560 FLAGS (\Seen) INTERNALDATE " 6-Feb-2009 15:14:55 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {218}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: * 12 FETCH (UID 24688 RFC822.SIZE 3832 FLAGS (\Seen) INTERNALDATE "22-May-2009 13:22:47 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {237}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: * 11 FETCH (UID 24687 RFC822.SIZE 4418 FLAGS (\Seen) INTERNALDATE "22-May-2009 14:46:41 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {197}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: * 10 FETCH (UID 24686 RFC822.SIZE 19940 FLAGS (\Seen) INTERNALDATE " 8-Jun-2009 10:55:32 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {210}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: * 9 FETCH (UID 24685 RFC822.SIZE 5228 FLAGS (\Seen) INTERNALDATE " 8-Jun-2009 17:22:35 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {194}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: * 8 FETCH (UID 24684 RFC822.SIZE 5132 FLAGS (\Seen) INTERNALDATE " 1-Jul-2009 17:05:57 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {201}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: * 7 FETCH (UID 24683 RFC822.SIZE 3901 FLAGS (\Seen) INTERNALDATE "23-Jul-2009 17:06:09 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {222}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: * 6 FETCH (UID 24682 RFC822.SIZE 37603 FLAGS (\Seen) INTERNALDATE "17-Mar-2010 17:00:16 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {203}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.600"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 5 FETCH (UID 24681 RFC822.SIZE 22806 FLAGS (\Answered \Seen) INTERNALDATE " 3-Apr-2010 04:15:17 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {354}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 4 FETCH (UID 24680 RFC822.SIZE 3936 FLAGS (\Answered \Seen) INTERNALDATE "17-May-2010 16:55:51 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {234}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 3 FETCH (UID 24679 RFC822.SIZE 6015 FLAGS (\Answered \Seen) INTERNALDATE "27-May-2010 18:21:25 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {706}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 2 FETCH (UID 24677 RFC822.SIZE 1129 FLAGS (\Seen) INTERNALDATE " 7-Jun-2010 12:49:01 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {323}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 1 FETCH (UID 24676 RFC822.SIZE 1701 FLAGS (\Seen) INTERNALDATE " 4-Jul-2010 12:28:59 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {313}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 14 FETCH (UID 24696 RFC822.SIZE 1588 FLAGS (\Seen) INTERNALDATE "19-Jul-2010 10:31:02 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {166}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 15 FETCH (UID 24697 RFC822.SIZE 19594 FLAGS (\Seen) INTERNALDATE " 7-Dec-2010 16:50:49 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {344}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 16 FETCH (UID 24698 RFC822.SIZE 4183 FLAGS (\Seen) INTERNALDATE " 8-Dec-2010 16:52:24 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {216}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 17 FETCH (UID 28726 RFC822.SIZE 1605 FLAGS (\Seen) INTERNALDATE "30-Oct-2011 10:30:28 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {215}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 18 FETCH (UID 29087 RFC822.SIZE 1179 FLAGS (\Seen) INTERNALDATE " 7-Nov-2011 10:49:17 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {332}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: * 24 FETCH (UID 30270 RFC822.SIZE 547 FLAGS (\Seen) INTERNALDATE " 1-Dec-2011 10:22:37 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {264}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.616"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: * 19 FETCH (UID 29942 RFC822.SIZE 3054 FLAGS (\Seen) INTERNALDATE " 5-Dec-2011 14:44:14 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {225}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: * 20 FETCH (UID 30176 RFC822.SIZE 4876 FLAGS (\Seen) INTERNALDATE "13-Dec-2011 21:49:44 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {299}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: * 21 FETCH (UID 30183 RFC822.SIZE 2053 FLAGS (\Seen) INTERNALDATE "14-Dec-2011 09:34:32 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {257}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: * 22 FETCH (UID 30193 RFC822.SIZE 4132 FLAGS (\Seen) INTERNALDATE "14-Dec-2011 16:11:14 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {751}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: * 23 FETCH (UID 30222 RFC822.SIZE 5471 FLAGS (\Seen) INTERNALDATE "15-Dec-2011 21:03:09 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {322}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: * 25 FETCH (UID 30284 RFC822.SIZE 3539 FLAGS (\Seen) INTERNALDATE "18-Dec-2011 11:48:47 +0100" BODY[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO CC USER-AGENT X-RC-ATTACHMENTCC X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)] {692}"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: )"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.631"	"127.0.0.1"	"SENT: A0008 OK FETCH completed"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.647"	"127.0.0.1"	"RECEIVED: A0009 LOGOUT"
"IMAPD"	1535560	11860	"2011-12-19 06:18:30.647"	"127.0.0.1"	"SENT: * BYE Have a nice day[nl]A0009 OK Logout completed"


User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: SORT returns wrong row order

Post by dzekas » 2011-12-19 19:06

rosali wrote:I think this is a bug
Could you use http://www.hmailserver.com/devnet/?page=issuetracker for that.

rosali
Normal user
Normal user
Posts: 101
Joined: 2008-01-13 18:32

Re: SORT returns wrong row order

Post by rosali » 2011-12-20 06:33

Ok. Done.

Post Reply