I just imported all the emails from an old sympa mailing list (using the MBOX import guide), but some of the posts seem to be displayed out of order. However, the date stamps are correct, so I’m not sure why this is happening. I need to fix this over all imported threads, of which there are fairly many.
You can look at this post for an example of what I’m talking about, the date stamps go Jul 7, Jul 7, Jul 9, Jul 16, Aug 1, and back to Jul 7).
Is there any command I can run to re-sort the posts by date or other suggestions?
There’s a rake task for sorting posts within a topic, but I do not recommend using it on more than a couple of topics as long as you still have a chance to fix the order within the import script.
Thanks for the mbox file. It looks like the sorting never really worked. It must have been luck that all the mbox files I imported in the past had the correct order.
Please bear in mind that it’s still possible for some messages to be appear to be in the wrong order. That’s because the post date reflects the value of the email’s Date header. It’s possible that the email client used the wrong date when sending an email. The import script determines the primary sort order by looking at the In-Reply-To and References header in order to prevent replies from showing up before any email it referenced.