I recently asked this question and worked out that the reason a single email message is displaying out of order is not in fact because of the date, but because of the order of the messages. I would like to modify my script to make sure all messages are in the correct order, but am unsure how to do this. Is it just based on the order in which the files appear, or is there a special part of the maildir headers which specify this?
Here is an example of what I mean: Example
In general, every MUA I use, including Thunderbird, Evolution and mail2web.com can order by date, but will be default order by the "message number". I am on a shared host which I believe uses qmail. The message number tag information must be kept somewhere.
edit: I tried moving all files to a temp directory and back again, which has shown that it is the file order which is responsible for the message number. I am however unsure as to why the messages from a few days in December have been moved to a much lower number than the numbers of messages on either side of those date. The filenames are timestamps and should be sequential, so unless mv movied the files in a strange order, I do not understand why the message numbers would not be restored for these particular files.