I think there's a huge bug with downloading/synchronisation in Mail.app with an IMAP server:
When it downloads a huge amount of emails at once (ie: when you configure an IMAP account for the first time) it sets the receive-date as the date that you downloaded it, NOT to the date that you actually received that message.
For example I recently synchronized a couple of hundred email messages since I moved them recently through my web-interface (Fastmail) to another folder and just now my mail.app synchronized it and now all these email messages are flagged as if received today, not to the actual date that they were received...
Any way to solve this?